CURRENT PROGRESS TOWARD SOLUTION:
This is the updated code:
sql = "INSERT INTO Strings (String_Name, Long_Text, Short_Text, Alternate_Text, Multi_String_ID, Lang_ID) VALUES (?,?, ?,?,?,?)"
Dim command = New OleDbCommand(sql, pConn)
command.Parameters.AddWithValue("@webStringName", "String_Name")
command.Parameters.AddWithValue("@webLang_String", "Long_Text")
command.Parameters.AddWithValue("@ptsShortText", "Short_Text")
command.Parameters.AddWithValue("@webAltText", "Alternate_Text")
command.Parameters.AddWithValue("@webMultiStringID", "Multi_String_ID")
Changed above line to this... command.Parameters.AddWithValue("@webMultiStringID", OleDbType.Integer).Value = webMultiStringID
command.Parameters.AddWithValue("@webLang_Code", "Lang_ID")
command.ExecuteNonQuery()
ORIG POST:
I am trying to create and INSERT statement with and OLE adapter. I had it working without paramtersm but now I am trying to add parms and am having issues with the syntax. Ha
Here is the code so far...
command = New OleDbCommand(sql, pConn)
sql = "INSERT INTO Strings (String_Name, Long_Text, Short_Text) VALUES (?,?, """ & ptsShortText & """)"
command.Parameters.Add("@webStringName", OleDbType.VarChar, 250, "String_Name")
command.Parameters.Add("@webLang_String", OleDbType.VarChar, 250, "Long_Text")
command = New OleDbCommand(sql, pConn)
command.ExecuteNonQuery()
Was just trying to get the first two variables parameterized.
Any suggestions would be greatly appreciated.
EDIT: Fixed SQL