Error with ExecuteTable

N1c0_ds

Active Member
Licensed User
This is my app_start sub, I grayed out the rest of the code from where the error happens:

B4X:
SQLRead.New1
SQLConn.New1
SQLCmd.New1("",SQLConn.Value)
SQLConn.Open("Data Source = " & AppPath & "\database.gdb")
SQLCmd.CommandText="select * from Name"
[COLOR="Red"]SQLCmd.ExecuteTable("tblMain",0)[/COLOR]
[COLOR="Silver"]FormLib.New1("FrmMain",B4PObject(1))
FormLib.MinimizeBox=false
Registry.New1
Registry.RootKey(registry.rtCurrentUser)
Hardware.New1
Contextsearch.New1
Contextsearch.AddItem("Copy")
Contextsearch.AddItem("Paste")
FormLib.AddContextMenu("txtSearch",Contextsearch.Value)
frmMain.ForeLayer=True
FrmMain.Show
FrmMain.Focus
Hardware.SIPEnabled=False
GetSettings 'The last thing to be done. If it crashes, it will exit the sub![/COLOR]

It says it's unable to execute a cast on object type "System.data.sqlite.sqliteconnection" to "System.Windows.Forms.Control" or something like this (roughly translated from french).

TblList is a table, database.gdb is a SQL DB created from a CSV and Main is a DB in database.gdb

What did I do wrong?
 
Top