Syntax error in INSERT INTO statement.
USRNAME text
PASS text
NAME text
LASTNAME text
POSITION text
DEPARTMENT text
INPUTDATE date/time
STAT text
REQUESTDATE date/time
Code (VB.NET)
str = "INSERT INTO USRNAME (USRNAME,PASS,NAME,LASTNAME,POSITION,DEPARTMENT,INPUTDATE,STAT,REQUESTDATE ) VALUES ('" & txtUSRNAME.Text & "','" & txtPASS.Text & "','" & txtName.Text & "','" & txtSurname.Text & "','" & txtPOSITION.Text & "','" & txtDEPT.Text & "','" & DateTimePicker1.Value & "','" & txtSTATUS.Text & "','" & txtREQDATE.Value & "')"
'str = "INSERT INTO TEST (A,B) VALUES ('1','13')"
'objCmd = New OleDbCommand(str, conn)
objCmd = New OleDbCommand
With objCmd
.Connection = conn
.CommandText = str
.CommandType = CommandType.Text
End With
Try
objCmd.ExecuteNonQuery()