Results 1 to 4 of 4
  1. #1
    Join Date
    May 2009
    Posts
    2

    Unanswered: Newbie simple question

    Hey guys !

    I just created my first MDB query using the ADO tutorials with an ASP file...
    Everything is working fine but I do have one variable that I need to query which has two words with a space in between. The code does not seem to be able to interpret the space in this one.

    I need this to work since the DB is from another software. Probably a simple well placed "" but please tell me where I should do the changes, here's my code :

    set rs = Server.CreateObject("ADODB.recordset")
    rs.Open "SELECT Door, Description, User Name, Time FROM events", conn
    %>

    Thx !

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580
    Try to avoid using spaces in field, control or object names.

    but

    [Encapsulate them with square brackets like this]

    set rs = Server.CreateObject("ADODB.recordset")
    rs.Open "SELECT Door, Description, [User Name], Time FROM events", conn
    %>

    PS You may have a problem with TIME as it is a reserved word
    Last edited by garethdart; 05-18-09 at 19:16.
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  3. #3
    Join Date
    May 2005
    Posts
    1,191
    On Gareth's point, see the full list of Access Reserved Words.
    Me.Geek = True

  4. #4
    Join Date
    May 2009
    Posts
    2

    Thx !

    WOW !

    Thx for the quick replies guys !
    Made the change and it's all working perfect

    Long live DBFORUMS !! ::cheers::

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •