Article View: free.it.visual-basic
Article #3152problema con aggiornamento recordset Ado
From: Beba
Date: Wed, 18 Sep 2002 15:49
Date: Wed, 18 Sep 2002 15:49
48 lines
2654 bytes
2654 bytes
ciao a tutti.
ho un problema con un maledetto rs che non viene aggiornato subito.
premetto che sto aggiungendo dei dati in una lista e cio' che avviene �.....
....aggiungo il primo record,la lista rimane vuota....
....aggiungo il secondo record,compaiono tutte e due! :-(
Vi allego il codice che utilizzo,ma faccio una postilla:ho utilizzato la
stessa sub con Msde (ed Ado) e Sql Server (ed Ado) e per magio....funziona!
Ora uso Ado e Access 2000.
Public Sub Aggiorna_Mod()
Dim rsMod As ADODB.Recordset
Dim sSql As String, sCod As String, sDescriMod As String
sCod = dcCli.Recordset![CodCliente]
sSql = "select * from ModuliCli where [CodCliente]='" & sCod & "' order
by CodCliente"
Set rsMod = New ADODB.Recordset
rsMod.Open sSql, MyDb, adOpenKeyset, adLockOptimistic <---ho dei
dubbi qui...a qs. punto!
LstModuli.Clear
With rsMod
If Not (.EOF And .BOF) Then
.MoveFirst
While Not .EOF
' recupero la descrizione
dcModuli.Recordset.Find "[CodModulo]='" & ![CodModulo] &
"'", , , 1
If Not .EOF Then sDescriMod =
dcModuli.Recordset![DescriModulo] Else sDescriMod = ""
LstModuli.AddItem sDescriMod
LstModuli.ItemData(LstModuli.NewIndex) = ![IdModulo]
.MoveNext
Wend
End If
End With
Set rsMod = Nothing
End Sub
provando a far visualizzare il recordcount...cose spettacolari...prima a
0,poi direttamente a 2!
Mi sapete aiutare?
Grazie
Beba
Technical Details
Message-ID:
<Wf1i9.127534$pX1.4560074@news2.tin.it>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!sn-xit-08!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!news.mailgate.org!nntp.infostrada.it!news-out.tin.it!news-in.tin.it!news2.tin.it.POSTED!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ITALIAN,ASCII X-Google-Thread: f94ee,9f92f40d355a25c0,start X-Google-Attributes: gidf94ee,public X-Google-ArrivalTime: 2002-09-18 08:52:11 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!sn-xit-08!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!news.mailgate.org!nntp.infostrada.it!news-out.tin.it!news-in.tin.it!news2.tin.it.POSTED!not-for-mail From: "Beba" <deborah@microramo.it> Newsgroups: free.it.visual-basic Subject: problema con aggiornamento recordset Ado Lines: 50 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Message-ID: <Wf1i9.127534$pX1.4560074@news2.tin.it> Date: Wed, 18 Sep 2002 15:49:10 GMT NNTP-Posting-Host: 217.172.212.51 X-Complaints-To: newsmaster@tin.it X-Trace: news2.tin.it 1032364150 217.172.212.51 (Wed, 18 Sep 2002 17:49:10 MET DST) NNTP-Posting-Date: Wed, 18 Sep 2002 17:49:10 MET DST Organization: TIN