Results 1 to 3 of 3

Thread: Access97 table with a dash in it's name [RESOLVED]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    Minnesota
    Posts
    91

    Access97 table with a dash in it's name [RESOLVED]

    Hi all,

    I am stuck with an old Access97 table (SO-Entry) and working with VB6. I am trying to open an ADO connection and get an error.

    strSQL = "select * from so-entry order by bill_co"
    rsSOEntry.Open strSQL, cnSales, adOpenForwardOnly, adLockOptimistic
    (I'll dump the select * when I get this working)

    I receive a 'run time error -2147217900, syntax error in from clause'.

    This must be caused by the dash that's in the table name SO-Entry because I can open all other tables in the database.

    Any idea on how to get this to open? I'm not allowed to change the table name.

    tia,
    Last edited by Stumbler; Jul 25th, 2003 at 11:42 AM.
    Stumbler

  2. #2
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    Use [] around name
    Code:
    strSQL = "select * from [so-entry] order by bill_co"

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    Minnesota
    Posts
    91
    Many thanks Andrey!

    It must be Friday 'cause I knew that.
    Stumbler

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