Results 1 to 5 of 5

Thread: Damn You Ado!!! Damn You To Hell!!!

  1. #1
    spetnik
    Guest

    Angry 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

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    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]

  3. #3
    spetnik
    Guest
    hmm, it actually seems to be with any select statement

  4. #4
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    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'"

  5. #5
    spetnik
    Guest
    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
  •  



Click Here to Expand Forum to Full Width