imstillatwork
IS-IT--Management
This Code Works Fine (may need to be optimised though)
I want to add another row to the same table, If I copy this code and change the values (strDesc_1 to strDesc_2 etc..etc.. ) The second insert crpas out. It gives a error:
Microsoft JET Database Engine error '80040e07'
Data type mismatch in criteria expression.
/test/POFORM/addrequest.asp, line 241
If I copy it exactly and insert the same values twice, it works. Why wont it allow new values in the second copy of the code.? (all in same ASP.)
Set Conn = Server.CreateObject("ADODB.Connection"
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("admin/PO.mdb" & ";"
response.write ("<br> "&strID&""
strSQL = "Insert Into tblItem([quantity]," _
& "[description]," _
& "[price]," _
& "[request_id] ) " _
& "Values('"&cstr(strQ_1)&"'," _
& "'"&cstr(strdesc_1)&"'," _
& "'"&cstr(strUnitcost_1)&"'," _
& "'"&cstr(strID)&"' )"
response.write strSQL
Conn.Execute strSQL
Set conn= Nothing
all my variables are dimed and set correctly
why can't I change the values in the second copy of the code???
I want to add another row to the same table, If I copy this code and change the values (strDesc_1 to strDesc_2 etc..etc.. ) The second insert crpas out. It gives a error:
Microsoft JET Database Engine error '80040e07'
Data type mismatch in criteria expression.
/test/POFORM/addrequest.asp, line 241
If I copy it exactly and insert the same values twice, it works. Why wont it allow new values in the second copy of the code.? (all in same ASP.)
Set Conn = Server.CreateObject("ADODB.Connection"
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("admin/PO.mdb" & ";"
response.write ("<br> "&strID&""
strSQL = "Insert Into tblItem([quantity]," _
& "[description]," _
& "[price]," _
& "[request_id] ) " _
& "Values('"&cstr(strQ_1)&"'," _
& "'"&cstr(strdesc_1)&"'," _
& "'"&cstr(strUnitcost_1)&"'," _
& "'"&cstr(strID)&"' )"
response.write strSQL
Conn.Execute strSQL
Set conn= Nothing
all my variables are dimed and set correctly
why can't I change the values in the second copy of the code???