NilObjectException when connecting to DB

[code] Dim dbitem As FolderItem = GetOpenFolderItem("")
Dim eaBasic AS New SQlitedatabase

If dbItem <> Nil And dbItem.Exists Then
eaBasic.DatabaseFile = dbitem

If eabasic.Connect Then
  MsgBox("Connected to database successfully!")
Else
  MsgBox("DB Connection Error: " + eabasic.ErrorMessage)
End If

End If[/code]

Definitions in Modul1:
eabasic is a global Sqlitedatabase

the above code is in the open-event of the APP

Here it works and I can get Datas from the db

But afterwards, in any other window, though I am connected to the db (have the same question there) I cannot get any data.

Only if I do again the getfolderitem-converstion, but this cannot be the sense, to choose the db 60 times …

If you want to have your database connection available in all windows you need to put the connection somewhere else. Like the app or a database module. Also you need to make your database a property and not a variable.

It is in the open-event of the APP! What do you mean then when you say somewhere else, llike the app?

And the database is a property in Module1, so it is a global property. But it has to be variable, because I want to change it in runtime.

You are declaring a local eaBasic variable in App.Open. Change the following line

Dim eaBasic AS New SQlitedatabase

to

eaBasic = New SQlitedatabase

Thank you very much. that was it