王彬 wrote:

>Hi,all
>I want to access a database,but I meet with some problems.
>
>For example:
>The SQL string is:"SELECT * FROM test"
>When I "executeQuery" this SQL,a "SQLException" will happen -- "Table not 
>found in statement [SELECT * FROM test]"
>But the table "test" does exist.
>
>Then I check another SQL: "INSERT INTO test VALUES(...,...,...)"
>And this time,it works.
>  
>
The problem is that your tables are NOT in upper case. You need to quote
table and field names that are not in upper case. If you are using the
query tools, I think that you can usually quote with a double quote. If
you are writing SQL in macros, then you should get the quote character
from the connection. In this case, download this document:
http://www.pitonyak.org/database/OOoBaseBinaryFields.odt

And search for the text DBQuoteName, at least I think that is the name
of the function that I wrote to do this.... Either way, I probably added
it into the DBUtilities at the end of the document if you need to search
for it.

-- 
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to