Results 1 to 6 of 6

Thread: [RESOLVED] sql syntax error

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2005
    Location
    NTU, Singapore
    Posts
    42

    Resolved [RESOLVED] sql syntax error

    can someone please tell me what is wrong in syntax of this statement

    Dim strUser As String
    Dim dbs As DAO.Database
    Set dbs = CurrentDb
    Dim sql As String

    strUser = Environ("Username")
    sql = "INSERT INTO LogTable(Username,Date,Time,EditFields) VALUES('strUser',date,time,'New Mailbox created');"
    dbs.Execute sql


    It keeps giving a syntax error in "Insert Into" statement. Thanks

    Oh .. forgot to mention.. the LogTable has five fields (the first one is autogenerated number). Can it be the reason for the error?
    Last edited by rochak; Aug 10th, 2005 at 10:59 PM.

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