Re: Reading Access DB: get someteimes Data - sometimes not
From: Val Mazur (group51a_at_hotmail.com)
Date: 07/28/04
- Next message: Val Mazur: "Re: saving a select stament to a txt file"
- Previous message: Val Mazur: "Re: Shaped Recordset and Updatebatch - VB6 & ADO & SQL Server 2000"
- In reply to: Marcel Gätzi: "Reading Access DB: get someteimes Data - sometimes not"
- Next in thread: Marcel Gätzi: "Re: Reading Access DB: get someteimes Data - sometimes not"
- Reply: Marcel Gätzi: "Re: Reading Access DB: get someteimes Data - sometimes not"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 28 Jul 2004 00:09:31 -0400
Hi,
I do not see anything wrong in a code, except it could be simpler. If it
works on all PCs, except one, then it could be related to the MDAC
corruption. Do you get any error message?
Your code actually should look like (you do not need to check for BOF and
EOF in your case and do not need to use MoveNext)
Set rst = cmd.Execute()
If Not rst is Nothing Then
Do While Not rst.EOF
'************************* in the beginning, data is retrieved
Call rst.MoveNext
Loop
End If
-- Val Mazur Microsoft MVP "Marcel Gätzi" <MarcelGtzi@discussions.microsoft.com> wrote in message news:408B8031-060B-4121-B955-0BD7B445F6F8@microsoft.com... > Hi, > > I have a very funny situation with reading the same Access db with the > same sql statement. Normaly I get data, then not anymore. > > I have this situation only at one customer - the others work fine. > According to the customer - after this occures the server crashes. Has > anyone a clue what's goin on here? Here's the code I use: > > cnn.Provider = "Microsoft.Jet.OLEDB.4.0;" > lsConnect = "Data Source=" + fuSetFilename(lsDBPath, "db.mdb") > cnn.Open lsConnect > cnn.CommandTimeout = 6000 > Set cmd.ActiveConnection = cnn > > ls_SQL = "Select Key1 From TableXl Where ID = 1 Order By Key1;" > > cmd.CommandText = ls_SQL > Set rst = cmd.Execute() > > If rst.BOF And rst.EOF Then > '************************** sometimes True > Else > Call rst.MoveFirst > Do While Not rst.EOF > '************************* in the beginning, data is retrieved > Call rst.MoveNext > Loop > End If > > rst.Close > > further information: > VB 6.0 > Runs on Windows Server 2000 > Database is on a local Directory! >
- Next message: Val Mazur: "Re: saving a select stament to a txt file"
- Previous message: Val Mazur: "Re: Shaped Recordset and Updatebatch - VB6 & ADO & SQL Server 2000"
- In reply to: Marcel Gätzi: "Reading Access DB: get someteimes Data - sometimes not"
- Next in thread: Marcel Gätzi: "Re: Reading Access DB: get someteimes Data - sometimes not"
- Reply: Marcel Gätzi: "Re: Reading Access DB: get someteimes Data - sometimes not"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|