| | |
updating records using asp and mysql
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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+"'
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+"'
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
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
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..
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
ohgosh
![]() |
Similar Threads
- updating records using php and mysql (PHP)
- can asp work with mySQL (ASP)
- can i use mysql database with asp (ASP)
Other Threads in the ASP Forum
- Previous Thread: syntax error: i cant find it..HELP!
- Next Thread: bu
Views: 5488 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for ASP
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection calendar changeable connection current database databaseconnection diagnostics dreamweaver excel fso html iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile query record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit update web webserver windows7





