1. Beatrix Willius
  2. as SQLite DB Server
  3. Donnerstag, Juni 04 2020, 01:19 PM
  4.  Abonnieren via E-Mail
When I change the example everything works fine, but in my code only the database is created and not the table. What am I doing wrong?


Private Sub ConnectToDatabaseRemote()

remote_db = new VSqliteDataBase

dim options as string //get registration

remote_db.Host = Remote_Server
remote_db.UserName = Remote_Username
remote_db.Password = Remote_Password
remote_db.Port = Remote_Port
ConnectedToSQLite = remote_db.Connect()
if not ConnectedToSQLite then Return

remote_db.databaseName = OriginalDBName + ".sqlite"
ConnectedToSQLite = remote_db.CreateDatabaseFileEx()
if not ConnectedToSQLite then Return

try
Dim theSQL As String = "CREATE VIRTUAL TABLE if not exists bodyindex USING fts4(tokenize=unicode61,content='', messagebody);"
remote_db.ExecuteSQL(theSQL)
ConnectedToSQLite = True
catch err as DatabaseException
//to do: error here
end try

End Sub


There is no exception. remote_db doesn't show any errors. But nothing happens.

VServer 10.3.
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Thanks! You don't want to know how long it took me to find the bug.
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Found the problem: ExecuteSQL does't work but SQLExecute does. Bug or feature? I'd expect at least an error.
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Here is the vlog output:

ÿþValentina_SetDebugLevel...
PARAM: inLevel = 3
return

RBDB_VSqlite_Database_SetEmbSerial...
return

RBDB_VSqlite_Database_SetPort...
return

RBDB_VSqlite_Database_Connect...
RBDB_VSqlite_Database_Connect_Remote...
PARAM: host = "127.0.0.1"
PARAM: user = "sa"
PARAM: password = "sa"
PARAM: Port = 15532
PARAM: db_name = ""
return res = 1

return res = 1

RBDB_VSqlite_Database_CreateDatabaseFileEx...
return res = 1

RBDB_Valentina_ExecuteSQL...
PARAM: db = 140677156014016
PARAM: sql = "CREATE VIRTUAL TABLE if not exists bodyindex USING fts4(tokenize=unicode61,content='', messagebody);"
VSqlite_Engine_getLastErrorCode...
return (int) gV4RB_Error = 0

VSqlite_Engine_getLastErrorString...
return res.get() = ""

VSqlite_Engine_getLastErrorCode...
return (int) gV4RB_Error = 0

VSqlite_Engine_getLastErrorCode...
return (int) gV4RB_Error = 0

RBDB_VSqlite_Database_GetConnection...
return res = 105553117413376

RBDB_VSqlite_Database_GetConnectionTimeout...
return res = 300

RBDB_VSqlite_Database_GetEmbSerial...
Kommentar
There are no comments made yet.
  • Seite :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.