Page 1 of 1
No such table ?!
Posted: Sun 24 Jun 2012 06:14
by Thierry0726
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
Re: No such table ?!
Posted: Mon 25 Jun 2012 11:56
by ZEuS
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.
Re: No such table ?!
Posted: Mon 25 Jun 2012 15:55
by Thierry0726
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
Re: No such table ?!
Posted: Wed 27 Jun 2012 06:18
by Thierry0726
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...
Re: No such table ?!
Posted: Wed 27 Jun 2012 10:49
by ZEuS
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.
Re: No such table ?!
Posted: Wed 27 Jun 2012 19:41
by Thierry0726
ok, thanks, i send it now
regards
Re: No such table ?!
Posted: Sun 01 Jul 2012 16:19
by Thierry0726
hi
did you received my mail ?
tia
Re: No such table ?!
Posted: Mon 02 Jul 2012 08:02
by ZEuS
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.
Re: No such table ?!
Posted: Mon 02 Jul 2012 13:25
by Thierry0726
Yessssssss !
it works fine, thank you !!!