Hello fellow ASPers,
I'm trying to write to table inside an access database that's related by a column. The browser keep returning the following error;
=====================================
Microsoft JET Database Engine (0x80040E07)
Data type mismatch in criteria expression.
======================================
Heres my code:
<%
data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("purchase.mdb")
sql_insert = "insert into tblOne (DateRequest, Site, DateNeeded, PurchaseType, Cost, SalesTax, ShippingHandling, ProgramArea, DescripItem, SubmitBy) values ('" & tblone_DateRequest & "', '" & tblone_Site & "', '" & tblone_DateNeeded & "', '" & tblone_PurchaseType & "', '" & tblone_Cost & "', '" & tblone_SalesTax & "', '" & tblone_ShippingHandling & "', '" & tblone_ProgramArea & "', '" & tblone_DescripItem & "', '" & tblone_SubmitBy & "')"
sql_insert2 = "insert into tblTwo (VendorName, VendorAddress, City, State, Zip) values ('" & tbltwo_VendorName & "', '" & tbltwo_VendorAddress & "', '" & tbltwo_City & "', '" & tbltwo_State & "', '" & tbltwo_Zip & "')"
' Creating Connection Object and opening the database
Set con = Server.CreateObject("ADODB.Connection")
con.Open data_source
con.Execute sql_insert
con.Execute sql_insert2
' Done. Close the connection
con.Close
Set con = Nothing
%>
What am I doing wrong? Any help would be greatly appreciated.
Thank you.
Groq