[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!! >.>
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!! >.>
Comment