By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,996 Members | 896 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,996 IT Pros & Developers. It's quick & easy.

help me about this insert command

P: 13
Expand|Select|Wrap|Line Numbers
  1. Dim sql03 As String
  2. Set rsopen3 = New ADODB.Recordset
  3. nameq = txtSname.Text & "," & txtFname.Text & " " & txtMname.Text & "."
  4. sql03 = "insert into Faculty (facultyID,Name,Hired) values ('FAC" & Format$(rsInc, "0000") & "' , '" & nameq & "' , '" & Format$(Now(), "dd/mm/yyyy") & "'"
  5. rsopen3.Open sql03, cnString, adOpenStatic, adLockOptimistic
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!! >.>
Jan 22 '08 #1
Share this Question
Share on Google+
2 Replies


kadghar
Expert 100+
P: 1,295
Expand|Select|Wrap|Line Numbers
  1. Dim sql03 As String
  2. Set rsopen3 = New ADODB.Recordset
  3. nameq = txtSname.Text & "," & txtFname.Text & " " & txtMname.Text & "."
  4. sql03 = "insert into Faculty (facultyID,Name,Hired) values ('FAC" & Format$(rsInc, "0000") & "' , '" & nameq & "' , '" & Format$(Now(), "dd/mm/yyyy") & "'"
  5. rsopen3.Open sql03, cnString, adOpenStatic, adLockOptimistic
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.
Jan 22 '08 #2

P: 13
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..
Jan 22 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.