1. Beatrix Willius
  2. as SQLite DB Server
  3. Thursday, June 04 2020, 01:19 PM
  4.  Subscribe via email
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.
Comment
There are no comments made yet.
Beatrix Willius Accepted Answer
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...
Comment
There are no comments made yet.
  1. more than a month ago
  2. as SQLite DB Server
  3. # 1
Beatrix Willius Accepted Answer
Found the problem: ExecuteSQL does't work but SQLExecute does. Bug or feature? I'd expect at least an error.
Comment
There are no comments made yet.
  1. more than a month ago
  2. as SQLite DB Server
  3. # 2
Ivan Smahin Accepted Answer
Comment
There are no comments made yet.
  1. more than a month ago
  2. as SQLite DB Server
  3. # 3
Beatrix Willius Accepted Answer
Thanks! You don't want to know how long it took me to find the bug.
Comment
There are no comments made yet.
  1. more than a month ago
  2. as SQLite DB Server
  3. # 4
  • Page :
  • 1


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

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories