I have an .sqlite file on a USB stick. After I have loaded the file and then try to connect to the database I get the following: “Operation cannot be completed because the database is closed.”
Is it closed because it is on a USB stick (doubtful)? Anyway, how on earth can I open it? I have a couple of apps that deal with databases (including Paul’s excellent SQLVue), and they can all open said database, so it is obviously possible. My code follows:
[quote] Dim dbFile As New FolderItem(Volume(Vol).Child(“MyDb.sqlite”))
If dbFile = Nil or dbFile.Exists = False Then
MsgBox(“Could not find database on disk.”)
Exit
End If
checkClasses = New SQLiteDatabase
checkClasses.DatabaseFile = dbFile
If checkClasses = Nil Then
MsgBox(“Can’t Load Database”)
End If
sql = “SELECT * FROM classesBackup WHERE specialSelection = 0”
data = checkClasses.SQLSelect(sql)
If checkClasses.Error Then
MsgBox(checkClasses.ErrorMessage)
End IF
If data <> Nil Then
While Not data.EOF
data.MoveNext
Wend
data.Close
End If[/quote]
The database is loaded OK, the problem occurs when I try to SELECT something from the database. I know currently I am not doing anything in the While Not data.EOF loop, but I have to clear up this problem first.