Page 1 of 1

can't connect to sqlite 3 database ?

Posted: 11.10.2006, 09:49
by domi.papin
hello,

I'm trying to connect to a sqlite3 databse through zeos component. I have copied sqlite3.dll of sqlite.org in my app dir. Then I've renamed it sqlite.dll.
I've affected the protocol property of ZConnection with 'sqlite'. the app compiles but raises an exception reading a nil address during connection.

Before trying to debug, I wanted to ask for help. Am I missing something ?
By the way, I've tried with success to access my database with sqliteadmin. Then, I'm little frustrated as I know it is made around zeos component.

Dominique

Posted: 11.10.2006, 12:26
by dragondz
Wich zeos lib you use?

I use SVN Zeoslib and it works fine with sqlite3 (without renaming the dll)

Posted: 11.10.2006, 13:31
by domi.papin
I use Svn testing branch of zeos.
If I don't rename the dll, zeos complains that it can't find sqlite.dll

Posted: 11.10.2006, 13:49
by domi.papin
Ok, I've figured that I should affect 'sqlite-3' to protocol.
Now it connects.

Second Step, I call ZConnect.GetTableNames but the function returns a zero count list. During a debug step, I copied the SQL string generated by GetTableNames and tried it under SQLite Administrator and ..... it works. Let's see if i can find the light :-)

Posted: 12.10.2006, 11:10
by domi.papin
More details :
ZConnect.GetTableNames always return a zero count list.
If I tried this 'SELECT TBL_NAME as TABLE_NAME FROM SQLITE_MASTER' with TZQuery then it also returns a zero count set.

It seems to me that I'm lost there 8-|

Posted: 13.10.2006, 11:08
by domi.papin
I didn't manage to make GetTableNames work. Instead, I've used TZMetadata components and it gives correct table names.

I haven't got time now to investigate on ZConnection.GetTableNames. hope I will take a closer look later.