Reading Access DB: get someteimes Data - sometimes not

From: Marcel Gätzi (MarcelGtzi_at_discussions.microsoft.com)
Date: 07/27/04


Date: Tue, 27 Jul 2004 10:09:07 -0700

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!