Subject RE: [firebird-support] Re: Error -104 on SELECT
Author Svein Erling Tysvær
>Yes, axcys is a schema. I removed the word to now use this command
>DatabaseQuery(1, "SELECT * FROM contacts;") and the error -104 was
>replaced with error -204 Table unknown. I checked the DB with
>FlameRobin, there is in fact a table called "contacts". Clicking DDL in
>FlameRobin yields the following (wanted to show the table and its
>columns to you and not sure another way to do so). Why does TB
>think there is no contacts Table?
>
>CREATE TABLE "contacts"
>(
> "Contact_Name" Char(30) NOT NULL,
> "ContactDesc" Char(50) NOT NULL,
> "Contact_Phone" Char(20) NOT NULL,
> "ContactFax" Char(20) NOT NULL,
> "Contact_Fax_2" Char(20) NOT NULL,
> "Contact_Fax_3" Char(20) NOT NULL,
> "EmailAddress" Char(50) NOT NULL,
> "EmailAddress1" Char(50) NOT NULL,
> "EmailAddress2" Char(50) NOT NULL,
> "Frequency" Integer NOT NULL
>);

If you use double quotes when creating a table, then the table and field names become case sensitive and you have to use double quotes whenever you refer to them. So try something like

DatabaseQuery(1, "SELECT * FROM ""contacts""")

or whatever you need to do to put double quotes within your strings.

The alternative is to create the table without double quotes, then your original query ought to have worked.

HTH,
Set