I’m trying to connect to my first created SQLite DB. with the following code:
str__SQLdb_FileName = “MySQLBookDatabase_Ver_01.sqlite”
SQLdb__01_FileName = “c:\00__XOJO\00__XOJO_DATABASES” + str__SQLdb_FileName
'setup the database so it can be opened
SQLdb__01 = New SQLiteDatabase
SQLdb__01_File = GetFolderItem(SQLdb__01_FileName)
SQLdb__01.DatabaseFile = SQLdb__01_File
'now see if we can connect to the file if it exists
if SQLdb__01.Connect then
MsgBox "we connected to the database file so it exists. "
''read all the Test setup records
Dim RS01 As RecordSet
RS01 = SQLdb__01.SQLSelect("SELECT * FROM tblBooks where (Record_Type) = ‘BOOKS’ ORDER BY Record_Type asc ")
While Not RS01.EOF
MsgBox “at Found a record.”
RS01.MoveNext
wend
MsgBox "we had read a record from the DB now we will quit"
Quit
My problem is this When ever I put a bad path to the db the program it still says connected and I get the ( MsgBox "we connected to the database file so it exists. ") and fails at the While Not RS01.EOF code line. (nilObjectExecption)
Can anyone tell me why it always connects.
Thanks
Dave