No such table ?!

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQLite in Delphi and C++Builder
Post Reply
Thierry0726
Posts: 12
Joined: Sun 24 Jun 2012 05:55

No such table ?!

Post by Thierry0726 » Sun 24 Jun 2012 06:14

Hello,

with C++ Builder XE2, i open my base like this ( without error )

SQLConnection->LibraryName = "dbexpsqlite40.dll"; // <library name> depends on your IDE version. See the table below.
SQLConnection->VendorLib = "sqlite3.dll";
SQLConnection->GetDriverFunc = "getSQLDriverSQLite";
SQLConnection->DriverName = "DevartSQLite";
SQLConnection->ConnectionName = "Devart SQLite";
SQLConnection->LoginPrompt = false;
SQLConnection->Params->Values["Database"] = "c:\\bd\\mabase.db";
SQLConnection->Open();

and when i do : "select * from Societe"
i have this error : "no such table : Societe"
i'm sure the table exist :
with cmd :
c:\BD\sqlite3 mabase.db
if i enter the command : '.tables', it display : "Societe"

what happens ?
TIA
Last edited by Thierry0726 on Mon 25 Jun 2012 20:16, edited 2 times in total.

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: No such table ?!

Post by ZEuS » Mon 25 Jun 2012 11:56

Please make sure that the table name is spelled correctly.
For example, the table name may contain some Unicode characters that have the same outline as English letters "o", "c", "i", "e", but the different character code.
If the table name is correct and the problem persists, try to create a small database with the table that causes the error, and send it to us.

Thierry0726
Posts: 12
Joined: Sun 24 Jun 2012 05:55

Re: No such table ?!

Post by Thierry0726 » Mon 25 Jun 2012 15:55

ok thanks,

If i understand well, file name must be ansi or ascii ( extended ) but NOT Unicode ?


i just try to open my table like this :
try
{
SQLQuery1->SQL->Clear();
SQLQuery1->SQL->Add("select * from Societe");
SQLQuery1->Active = true; // <-- error ; no such table
}
catch(...)
{
}

Before, i initialize my SQLConnection ( see my previous post ) and of course :
SQLQuery1->SQLConnection = SQLConnection;

even with this declaration to use ascci string but it doesn't work :
AnsiString MaChaine = "c:\\bd\\mabase.db";
SQLConnection->Params->Values["Database"] = MaChaine;

TIA

Thierry0726
Posts: 12
Joined: Sun 24 Jun 2012 05:55

Re: No such table ?!

Post by Thierry0726 » Wed 27 Jun 2012 06:18

Hello

If i do this with cmd, it works ! so my table exist
a problem with dbexpress or devart driver ? i'm very surprised and i do no what to do...

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: No such table ?!

Post by ZEuS » Wed 27 Jun 2012 10:49

Unfortunately, we still cannot reproduce the problem.
Please create a small database with the table that causes the error and send it to eugeniyz*devart*com.

Thierry0726
Posts: 12
Joined: Sun 24 Jun 2012 05:55

Re: No such table ?!

Post by Thierry0726 » Wed 27 Jun 2012 19:41

ok, thanks, i send it now
regards

Thierry0726
Posts: 12
Joined: Sun 24 Jun 2012 05:55

Re: No such table ?!

Post by Thierry0726 » Sun 01 Jul 2012 16:19

hi
did you received my mail ?
tia

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: No such table ?!

Post by ZEuS » Mon 02 Jul 2012 08:02

In your example, please try to remove spaces before and after "=" in the line:
AnsiString l_sNomBase = "DataBase = c:\\bd\\mabase.db";
like this:
AnsiString l_sNomBase = "DataBase=c:\\bd\\mabase.db";
When you are trying to add a "Param=Value" string to TStringList, the line divides into the name of the parameter and its value in the position of the "=" character. So, you get the name of the parameter as "Database " and its value as " c:\\bd\\mabase.db", with the leading space in it.

Thierry0726
Posts: 12
Joined: Sun 24 Jun 2012 05:55

Re: No such table ?!

Post by Thierry0726 » Mon 02 Jul 2012 13:25

Yessssssss !

it works fine, thank you !!!

Post Reply