fird
asked on
Error Type: Microsoft JET Database Engine (0x80040E07) Data type mismatch in criteria expression.
Error Type:
Microsoft JET Database Engine (0x80040E07)
Data type mismatch in criteria expression.
/vms/save_edited_vendor.as p, line 30
got this error when i run the system. i think it is because the company_id is integer. i don't know the format for integer in ASP. the code are as follows:
------------------
<%
'declare variables
Dim Conn,DSN,rs,strsql
company_id=session("compan y_id")
company_name= Request.Form("companyname_ text")
address= Request.Form("address_text ")
postcode= Request.Form("postcode_tex t")
city= Request.Form("city_text")
state= Request.Form("state_list")
phone= Request.Form("phone_text")
fax= Request.Form("fax_text")
email= Request.Form("email_text")
website= Request.Form("website_text ")
Set Conn=Server.CreateObject(" ADODB.Conn ection")
Conn.Open "Provider=Microsoft.Jet.OL EDB.4.0;Da ta Source=" & Server.MapPath("db/db1.mdb ")
Set SQL= Server.CreateObject("ADODB .Recordset ")
SQL.Open "SELECT * From vendor WHERE company_id='"&company_id&" '",Conn,2, 2 <--- line 30
SQL("company_name")=compan y_name
SQL("address")=address
SQL("postcode")=postcode
SQL("city")=city
SQL("state")=state
SQL("phone")=phone
SQL("fax")=fax
SQL("email")=email
SQL("website")=website
SQL.Update
Conn.Close
Set Conn = Nothing
%>
-----------------------
Thanks & Regards
Microsoft JET Database Engine (0x80040E07)
Data type mismatch in criteria expression.
/vms/save_edited_vendor.as
got this error when i run the system. i think it is because the company_id is integer. i don't know the format for integer in ASP. the code are as follows:
------------------
<%
'declare variables
Dim Conn,DSN,rs,strsql
company_id=session("compan
company_name= Request.Form("companyname_
address= Request.Form("address_text
postcode= Request.Form("postcode_tex
city= Request.Form("city_text")
state= Request.Form("state_list")
phone= Request.Form("phone_text")
fax= Request.Form("fax_text")
email= Request.Form("email_text")
website= Request.Form("website_text
Set Conn=Server.CreateObject("
Conn.Open "Provider=Microsoft.Jet.OL
Set SQL= Server.CreateObject("ADODB
SQL.Open "SELECT * From vendor WHERE company_id='"&company_id&"
SQL("company_name")=compan
SQL("address")=address
SQL("postcode")=postcode
SQL("city")=city
SQL("state")=state
SQL("phone")=phone
SQL("fax")=fax
SQL("email")=email
SQL("website")=website
SQL.Update
Conn.Close
Set Conn = Nothing
%>
-----------------------
Thanks & Regards
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You do not need a quote for integer
ASKER
thanks but i got this error when i ignore the quote:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'company_id='.
/vms/save_edited_vendor.as p, line 30
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'company_id='.
/vms/save_edited_vendor.as
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
for more information regarding your error try to check out the link might help...
http://www.adopenstatic.com/faq/80040e10.asp
Happy programming
http://www.adopenstatic.com/faq/80040e10.asp
Happy programming
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried ur solution but the page display this
SELECT * From vendor WHERE company_id=
if i use this company_id=session("compan y_id") does it means i display the value of company_id?
thanks 4 ur time
SELECT * From vendor WHERE company_id=
if i use this company_id=session("compan
thanks 4 ur time
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
BTW is the problem not solve yet... I saw that you already close a question similar to this which is posted by hongjun on anothe link.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It seems that you have forgot to set the Session("company_id") in a previous page or your session must have timedout when running/executing this page.
Pls make sure that you assign the company_id to Session("company_id") where necessary in your site before coming to this page.
Also just for the record, the SQL server implicitly converts character/string data to integer ... so even if you have the single quote in your sql statement, it will still work provided you have assigned the company_id to the Session("company_id").
Pls make sure that you assign the company_id to Session("company_id") where necessary in your site before coming to this page.
Also just for the record, the SQL server implicitly converts character/string data to integer ... so even if you have the single quote in your sql statement, it will still work provided you have assigned the company_id to the Session("company_id").
ASKER
thanks hongjun, gladxml, babuno & randeeps. I forgot to set the session("company_id") in the previous page. but i still got a problem in the same coding after i set the session in the previous page. the coding seems like working successfully but when i check the database, all fields are empty except the company_id(primary key). thanks again for ur help guys!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks guys for ur help. appreciated!