updating records using asp and mysql

Reply

Join Date: Sep 2005
Posts: 139
Reputation: aarya is an unknown quantity at this point 
Solved Threads: 0
aarya's Avatar
aarya aarya is offline Offline
Junior Poster

updating records using asp and mysql

 
0
  #1
Oct 28th, 2005
i m getting the error as
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/myweb/updat.asp, line 18, column 181
my code is

<% if session("bvuser")="true" then
struser=request("usercode")
stremail=request("email")
strfname=request("fname")
strlname=request("lname")
straddress=request("address")
straddress1=request("address2")
straddress2=request("address3")
strcity=request("city")
strcountry=request("country")
strpassword=request("password")
struser=session("usercode")
dim rsupdat,Conn,sql
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Driver={MySql ODBC 3.51 Driver}; Server=localhost; database=slogin; uid=user; pwd=pass;

option=3;"

set rsupdat=server.createobject("ADODB.connection")
sql="update users1 set email='"+stremail+"' and fname='"+strfname+"' and lname='"+strlname+"' and

address='"+straddress+"' and address1='"+straddress1+"' and address2='"+straddress2"' and city='"+strcity+"' and

country='"+strcountry+"' and password='"+strpassword+"' where usercode='"+struser+"';"

set rsupdat=Conn.execute(sql)
response.write("updat")
else
response.write ("login")
end if
%>

i m trying to upadat the database using mysql. i m learning asp. pls anybody figure out the mistake i have done.i tried so much but i could not figure it out
error is showing on

sql=update users1 set email='"+stremail+"' and fname='"+strfname+"' and lname='"+strlname+"' and

address='"+straddress+"' and address1='"+straddress1+"' and address2='"+straddress2"' and city='"+strcity+"' and

country='"+strcountry+"' and password='"+strpassword+"' where usercode='"+struser+"'
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 139
Reputation: aarya is an unknown quantity at this point 
Solved Threads: 0
aarya's Avatar
aarya aarya is offline Offline
Junior Poster

Re: updating records using asp and mysql

 
0
  #2
Oct 28th, 2005
i could remove the error by relacing this code
sql="update users1 set email='+stremail+' and fname='+strfname+' and lname='+strlname+' and address='+straddress+'

and address1='+straddress1+' and address2='+straddress2' and city='+strcity+' and country='+strcountry+' and

password='+strpassword+' where usercode='+struser+';"

but it is not upadating in my database
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 41
Reputation: ohgosh is an unknown quantity at this point 
Solved Threads: 0
ohgosh's Avatar
ohgosh ohgosh is offline Offline
Light Poster

Re: updating records using asp and mysql

 
0
  #3
Nov 6th, 2005
was it bcos of ur concatenation?

sql="update users1 set email='" & stremail & "' and fname='" & strfname & "' and lname='" & strlname & "' and address='" & straddress & "' and address1='" & straddress1 & "' and address2='" & straddress2 & "' and city='" & strcity & "' and
country='" & strcountry & "' and password='"+ & strpassword & "' where usercode='" & struser & ";"

and please check ur syntax for this part..
";" not "';"

and
and address2='"+straddress2"' and, u lack of a concatenation

let us know if my points are useful okie? should hear from u soon..
cheers,
ohgosh
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 139
Reputation: aarya is an unknown quantity at this point 
Solved Threads: 0
aarya's Avatar
aarya aarya is offline Offline
Junior Poster

Re: updating records using asp and mysql

 
0
  #4
Nov 8th, 2005
yes i tried i mnot getting tany error but not updating
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP Forum


Views: 5488 | Replies: 3
Thread Tools Search this Thread



Tag cloud for ASP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC