|
-
Jan 2nd, 2002, 04:16 PM
#1
Damn You Ado!!! Damn You To Hell!!!
I don't want to get off on a rant here, but I've got a major problem with ADO (or probably ODBC). I am using a SQL statement to return the names of the tables in a SYBASE database (SYBASE is 99.99% identical to MS SQL Server). When I run it in a non-ODBC tool, such as RapidSQL or DBArtisan, it runs fine. But when I run it with ADO, I get the following error:
[INTERSOLV][ODBC SQL Server driver][SQL Server]Incorrect syntax near the keyword 'SELECT'.
This is the SQL statement:
Code:
[COLOR=royal blue]SELECT[/COLOR] name [COLOR=royal blue]From[/color] sysobjects [COLOR=royal blue]WHERE[/color] type = 'U' [COLOR=royal blue]ORDER BY[/color] name
-
Jan 2nd, 2002, 04:20 PM
#2
Looks like it chokes on the word Name. It probably assumes that it's a keyword. Add brackets around the word name, that should fix it.
Code:
[COLOR=royal blue]SELECT[/COLOR] [name] [COLOR=royal blue]From[/color] sysobjects [COLOR=royal blue]WHERE[/color] type = 'U' [COLOR=royal blue]ORDER BY[/color] [name]
-
Jan 2nd, 2002, 04:22 PM
#3
hmm, it actually seems to be with any select statement
-
Jan 2nd, 2002, 04:26 PM
#4
Then I would assume its a problem with your ODBC driver.
Also, check out system stored procedure sp_tables, it should return what you wanted.
Code:
sp_tables null, null, null, "'TABLE'"
-
Jan 2nd, 2002, 04:35 PM
#5
yeah, thanx.
well, nevermind, it works with ADO, just not with the object that we have to use here to get recordsets
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|