Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2003
    Posts
    7

    Unanswered: SQL Stmt in ASP page as VBScript

    I have the following insert statement
    SQLStmt = "INSERT INTO SmartScreen_Items (Chart, Date, Name, [Control Type], [Load Order], Data)" & _
    "Values ('" & sChart & "', '" & sDate & "', '" & sName & "', 0, " & sLoadOrder & "," & _
    " '" & sData & "')"

    I am getting a sytax error on this statement. I have checked the Table it has exactly the same fields and also all are text fields except the Control type and load order.

    Thanx

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: SQL Stmt in ASP page as VBScript

    Originally posted by jainpriyanka
    I have the following insert statement
    SQLStmt = "INSERT INTO SmartScreen_Items (Chart, Date, Name, [Control Type], [Load Order], Data)" & _
    "Values ('" & sChart & "', '" & sDate & "', '" & sName & "', 0, " & sLoadOrder & "," & _
    " '" & sData & "')"

    I am getting a sytax error on this statement. I have checked the Table it has exactly the same fields and also all are text fields except the Control type and load order.

    Thanx
    Suggest you do the usual debug just after that line:

    Response.Write SQLStmt
    Response.End

    That will show you the actual SQL that is going to be executed. Look out for (e.g.):

    INSERT... Values ('A','B',,'D')

    (two commas in a row)

  3. #3
    Join Date
    Jan 2003
    Posts
    22

    reserved word?

    I think "Date" is a reserved word......try using [Date]

  4. #4
    Join Date
    Jan 2003
    Posts
    7

    Re: reserved word?

    Thanks a bunch!

    Originally posted by Shineyshoes
    I think "Date" is a reserved word......try using [Date]

  5. #5
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    If that didn't work, I did notice you don't have a space after the end of the first set of () - it just goes ")values". It shoud be ") values" no?

Posting Permissions

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