K
Kathy Burke
Ugh. I'm using the following in an asp.net. I get an Syntax Error in
INSERT INTO Statement on line Cmd1.ExecuteNonQuery().
I've made all my database fields text (just to eliminate that as a
potential problem). I changed all my variables in the insert statement
to text to test as shown below. Still getting the error! I've checked
again and again my db table and field names. Could someone please tell
me where to go from here??? THANKS, Kathy
Dim Conn1 As New OleDbConnection() ' conn string set globally
Dim Adapter As OleDbDataAdapter
Dim Cmd1 As OleDbCommand
Dim strSQL1 As String
strSQL1 = "INSERT INTO tblAnomaly (Date, WorkOrder, Customer, Line,
Station, Assy, SerialNo, User, Item, Type, Problem, ProblemDesc,
Comments, LineStop) VALUES ('08/10/03', '11233', 'XYZ', '07',
'Station1', '865-7446-03BA', '222', 'burkek', 'ToolA not used',
'Problem--Line Stop', 'Material Discrepancy', 'Does not meet spec',
'none', 'true')"
Conn1 = New OleDbConnection(strConn)
Cmd1 = New OleDbCommand(strSQL1, Conn1)
Conn1.Open()
Cmd1.ExecuteNonQuery()
Conn1.Close()
INSERT INTO Statement on line Cmd1.ExecuteNonQuery().
I've made all my database fields text (just to eliminate that as a
potential problem). I changed all my variables in the insert statement
to text to test as shown below. Still getting the error! I've checked
again and again my db table and field names. Could someone please tell
me where to go from here??? THANKS, Kathy
Dim Conn1 As New OleDbConnection() ' conn string set globally
Dim Adapter As OleDbDataAdapter
Dim Cmd1 As OleDbCommand
Dim strSQL1 As String
strSQL1 = "INSERT INTO tblAnomaly (Date, WorkOrder, Customer, Line,
Station, Assy, SerialNo, User, Item, Type, Problem, ProblemDesc,
Comments, LineStop) VALUES ('08/10/03', '11233', 'XYZ', '07',
'Station1', '865-7446-03BA', '222', 'burkek', 'ToolA not used',
'Problem--Line Stop', 'Material Discrepancy', 'Does not meet spec',
'none', 'true')"
Conn1 = New OleDbConnection(strConn)
Cmd1 = New OleDbCommand(strSQL1, Conn1)
Conn1.Open()
Cmd1.ExecuteNonQuery()
Conn1.Close()