Jack wrote:
> Hi,
> I have a sql statement in asp page as below
>
> sql = " INSERT INTO tblExpense (ENO, EntryDate,
> ContractedServiceExpense, " sql = sql & "TravelExpense,
> PersonnelExpense)" sql = sql & " VALUES('" & l_ENO & "', '" &
> l_Date & "', '" & l_contractedserviceexpense & "', '" &
> l_travelexpense & "', '" & personnelexpense & "')"
>
> The response.write on sql gives the following:
>
> INSERT INTO tblExpense (ENO, EntryDate, ContractedServiceExpense,
> TravelExpense, PersonnelExpense) VALUES('1', '03/01/2005', '5', '5',
> '10')
>
> However when I am trying to open the recordset, it gives me the
> following error:
>
> Error Type:
> Microsoft JET Database Engine (0x80040E07)
> Data type mismatch in criteria expression.
>
You're having this problem because you are using dynamic sql. Since you have
ignored my previous attempts to wean you off this dangerous crutch, study
this:
http://groups-beta.google.com/group/...UTF-8&c2coff=1
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"