G
Guest
I am writing a VB NET program, and I have set up the following InsertCommand
property and parameters:
dap1.InsetCommand = New OleDb.OleDbCommand( _
"INSERT INTO entry " & _
"(date, child, activity, starttime, endtime) " & _
"VALUES (?, ?, ?, ?, ?)", cnn1)
Dim prm11 As OleDb.OleDbParameter = _
dap1.InsertCommand.Parameters.Add("@date", _
OleDb.OleDbType.VarChar, 20, "date")
Dim prm12 As OleDb.OleDbParameter = _
dap1.InsertCommand.Parameters.Add("@child", _
OleDb.OleDbType.VarChar, 20, "child")
Dim prm13 As OleDb.OleDbParameter = _
dap1.InsertCommand.Parameters.Add("@activity", _
OleDb.OleDbType.VarChar, 25, "activity")
Dim prm14 As OleDb.OleDbParameter = _
dap1.InsertCommand.Parameters.Add("@starttime", _
OleDb.OleDbType.VarChar, 8, "starttime")
Dim prm15 As OleDb.OleDbParameter = _
dap1.InsertCommand.Parameters.Add("@endtime", _
OleDb.OleDbType.VarChar, 8, "endtime")
When I run my program, I receive an error with the INSERT INTO statement.
I am using a database created in Access 2003. When I use the exact same
code with the Northwind database, it runs fine.
Any ideas?
property and parameters:
dap1.InsetCommand = New OleDb.OleDbCommand( _
"INSERT INTO entry " & _
"(date, child, activity, starttime, endtime) " & _
"VALUES (?, ?, ?, ?, ?)", cnn1)
Dim prm11 As OleDb.OleDbParameter = _
dap1.InsertCommand.Parameters.Add("@date", _
OleDb.OleDbType.VarChar, 20, "date")
Dim prm12 As OleDb.OleDbParameter = _
dap1.InsertCommand.Parameters.Add("@child", _
OleDb.OleDbType.VarChar, 20, "child")
Dim prm13 As OleDb.OleDbParameter = _
dap1.InsertCommand.Parameters.Add("@activity", _
OleDb.OleDbType.VarChar, 25, "activity")
Dim prm14 As OleDb.OleDbParameter = _
dap1.InsertCommand.Parameters.Add("@starttime", _
OleDb.OleDbType.VarChar, 8, "starttime")
Dim prm15 As OleDb.OleDbParameter = _
dap1.InsertCommand.Parameters.Add("@endtime", _
OleDb.OleDbType.VarChar, 8, "endtime")
When I run my program, I receive an error with the INSERT INTO statement.
I am using a database created in Access 2003. When I use the exact same
code with the Northwind database, it runs fine.
Any ideas?