help me about this insert command

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lousylife
    New Member
    • May 2007
    • 13

    help me about this insert command

    [CODE=vb]Dim sql03 As String
    Set rsopen3 = New ADODB.Recordset
    nameq = txtSname.Text & "," & txtFname.Text & " " & txtMname.Text & "."
    sql03 = "insert into Faculty (facultyID,Name ,Hired) values ('FAC" & Format$(rsInc, "0000") & "' , '" & nameq & "' , '" & Format$(Now(), "dd/mm/yyyy") & "'"
    rsopen3.Open sql03, cnString, adOpenStatic, adLockOptimisti c[/CODE]

    I'm having trouble with my insert statement! Whenever I run the program, the system says "Syntax error in insert statement!" Can someone tell me what's the problem in that? Thanks!! newbie question!! >.>
    Last edited by Killer42; Jan 23 '08, 12:42 AM. Reason: Added CODE=vb tag
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    Originally posted by lousylife
    [CODE=vb]Dim sql03 As String
    Set rsopen3 = New ADODB.Recordset
    nameq = txtSname.Text & "," & txtFname.Text & " " & txtMname.Text & "."
    sql03 = "insert into Faculty (facultyID,Name ,Hired) values ('FAC" & Format$(rsInc, "0000") & "' , '" & nameq & "' , '" & Format$(Now(), "dd/mm/yyyy") & "'"
    rsopen3.Open sql03, cnString, adOpenStatic, adLockOptimisti c[/CODE]

    I'm having trouble with my insert statement! Whenever I run the program, the system says "Syntax error in insert statement!" Can someone tell me what's the problem in that? Thanks!! newbie question!! >.>
    i didnt check it well, but it seems that the only problem is that you're missing a parenthesis.
    Last edited by Killer42; Jan 23 '08, 12:44 AM. Reason: Just updated quote block to match OP

    Comment

    • lousylife
      New Member
      • May 2007
      • 13

      #3
      Originally posted by kadghar
      i didnt check it well, but it seems that the only problem is that you're missing a parenthesis.
      waaaaaaa!! thnx alot!! i miss something, and now it works..

      Comment

      Working...