ralphbell
asked on
Microsoft VBScript runtime error '800a01a8'
I am moving a web site that is written in asp. I can display the pages that pull info from a ms access database. The problem I have is trying to update info in the database from a form. I have very little asp experience. Any help to get this working would be greatly appreciated!!
Server setup is:
Microsoft Windows Server 2003
IIS (Internet Information Server) 6.0
ASP (Active Server Pages) 3.0+
ASP.NET
CDO (Collaboration Data Objects) 1.2.1
ColdFusion MX 6.1
FrontPage 2002
Perl 5.6
CGI (Common Gateway Interface)
PHP (Personal Home Pages) 4.2.3
Python 2.3
SSI (Server Side Includes)
SSL (Secure Socket Layer)
Our .net server platform current supports the following server file types:
.asax
.ascx
.ashx
.asmx
.aspx
.axd
.config
.cs
.csprorj
.licx
.rem
.resources
.resx
.soap
.vb
.vbproj
.vsdisco
.webinfo
Our Windows platform does not currently support the following:
XML (Extensible Markup Language)
Error Message:
Microsoft VBScript runtime error '800a01a8'
Object required: 'Provider=Microsoft.J'
/admin/listing2updX.asp, line 50
line 50 is:
strCon.Execute(sql)
which is executing line 16
sql= "update list2"
below is the entire code:
<%
Set adoCon=Server.CreateObject ("ADODB.Co nnection")
'Database connection info and provider
strCon = "Provider=Microsoft.Jet.OL EDB.4.0;Da ta Source=" &_
Server.MapPath("/data\db1. mdb") & ";"
nokey=request.querystring( "lid")
Set rs=Server.CreateObject("AD ODB.Record set")
rs.open "Select * from list2 where key=" & nokey , strCon, 3
wpass=rs("key")
if wpass <> request.form("address") then
sql= "update list2"
sql= sql & " set area ='" & request.form("area") & "',"
sql= sql & " county='" & Request.form("county") & "',"
sql= sql & " address='" &request.form("address")&" ',"
sql= sql & " city='" &request.form("city")&"',"
sql= sql & " state='" &request.form("state")&"', "
sql= sql & " zip='" &request.form("zip")&"',"
sql= sql & " price='" &request.form("price")&"', "
sql= sql & " mls='" &request.form("mls#")&"',"
sql= sql & " class='" &request.form("class")&"', "
sql= sql & " status='" &request.form("status")&"' ,"
sql= sql & " mlsarea='" &request.form("mlsarea")&" ',"
sql= sql & " ele1='" &request.form("ele1")&"',"
sql= sql & " junior1='" &request.form("junior1")&" ',"
sql= sql & " high1='" &request.form("high1")&"', "
sql= sql & " sqft='" &request.form("sqft")&"',"
sql= sql & "yrbuilt='" &request.form("yrbuilt")&" ',"
sql= sql & " tax='" &request.form("tax")&"',"
sql= sql & " taxyear='" &request.form("taxyear")&" ',"
sql= sql & " bed='" &request.form("bed")&"',"
sql= sql & " bath='" &request.form("bath")&"',"
sql= sql & " lrms='" &request.form("lrms")&"',"
sql= sql & " garage='" &request.form("garage")&"' ,"
sql= sql & " fplace='" &request.form("fplace")&"' , "
sql= sql & " pool='" &request.form("pool")&"',"
sql= sql & " exp='" &newstr(request.form("exp" ))&"',"
sql= sql & " upd='" &now&"',"
sql= sql & " input='" &request.form("city")&"',"
sql= sql & " rem='" &request.form("address")&" ',"
sql= sql & " flag='" &request.form("address")&" '"
sql = sql & " where key =" & request.querystring("lid")
response.write sql
strCon.Execute(sql)
rs.close
set rs=nothing
strCon.close
set strCon=nothing
response.redirect "listingsfortest.asp"
else
response.write " <center>¨¬n©ö¨¢©ö©ªE¡Ì¡Æ¢® ¨¡©÷¢¬©ø¢¥I¢¥U. <br>"
response.write alert & " ¥ì©ö¨ú¨¡¡Æ¢®¨ù¨ù¢¯a......< br>"
doc="<a href='listings.asp'>¥ì©ö¨ú ¨¡¡Æ¢®¡¾a< /a>"
response.write doc
end if
Function newstr(str)
newstr = Replace(Replace(str,"'","' '"),CHR(34 ),""" )
End function
%>
Server setup is:
Microsoft Windows Server 2003
IIS (Internet Information Server) 6.0
ASP (Active Server Pages) 3.0+
ASP.NET
CDO (Collaboration Data Objects) 1.2.1
ColdFusion MX 6.1
FrontPage 2002
Perl 5.6
CGI (Common Gateway Interface)
PHP (Personal Home Pages) 4.2.3
Python 2.3
SSI (Server Side Includes)
SSL (Secure Socket Layer)
Our .net server platform current supports the following server file types:
.asax
.ascx
.ashx
.asmx
.aspx
.axd
.config
.cs
.csprorj
.licx
.rem
.resources
.resx
.soap
.vb
.vbproj
.vsdisco
.webinfo
Our Windows platform does not currently support the following:
XML (Extensible Markup Language)
Error Message:
Microsoft VBScript runtime error '800a01a8'
Object required: 'Provider=Microsoft.J'
/admin/listing2updX.asp, line 50
line 50 is:
strCon.Execute(sql)
which is executing line 16
sql= "update list2"
below is the entire code:
<%
Set adoCon=Server.CreateObject
'Database connection info and provider
strCon = "Provider=Microsoft.Jet.OL
Server.MapPath("/data\db1.
nokey=request.querystring(
Set rs=Server.CreateObject("AD
rs.open "Select * from list2 where key=" & nokey , strCon, 3
wpass=rs("key")
if wpass <> request.form("address") then
sql= "update list2"
sql= sql & " set area ='" & request.form("area") & "',"
sql= sql & " county='" & Request.form("county") & "',"
sql= sql & " address='" &request.form("address")&"
sql= sql & " city='" &request.form("city")&"',"
sql= sql & " state='" &request.form("state")&"',
sql= sql & " zip='" &request.form("zip")&"',"
sql= sql & " price='" &request.form("price")&"',
sql= sql & " mls='" &request.form("mls#")&"',"
sql= sql & " class='" &request.form("class")&"',
sql= sql & " status='" &request.form("status")&"'
sql= sql & " mlsarea='" &request.form("mlsarea")&"
sql= sql & " ele1='" &request.form("ele1")&"',"
sql= sql & " junior1='" &request.form("junior1")&"
sql= sql & " high1='" &request.form("high1")&"',
sql= sql & " sqft='" &request.form("sqft")&"',"
sql= sql & "yrbuilt='" &request.form("yrbuilt")&"
sql= sql & " tax='" &request.form("tax")&"',"
sql= sql & " taxyear='" &request.form("taxyear")&"
sql= sql & " bed='" &request.form("bed")&"',"
sql= sql & " bath='" &request.form("bath")&"',"
sql= sql & " lrms='" &request.form("lrms")&"',"
sql= sql & " garage='" &request.form("garage")&"'
sql= sql & " fplace='" &request.form("fplace")&"'
sql= sql & " pool='" &request.form("pool")&"',"
sql= sql & " exp='" &newstr(request.form("exp"
sql= sql & " upd='" &now&"',"
sql= sql & " input='" &request.form("city")&"',"
sql= sql & " rem='" &request.form("address")&"
sql= sql & " flag='" &request.form("address")&"
sql = sql & " where key =" & request.querystring("lid")
response.write sql
strCon.Execute(sql)
rs.close
set rs=nothing
strCon.close
set strCon=nothing
response.redirect "listingsfortest.asp"
else
response.write " <center>¨¬n©ö¨¢©ö©ªE¡Ì¡Æ¢®
response.write alert & " ¥ì©ö¨ú¨¡¡Æ¢®¨ù¨ù¢¯a......<
doc="<a href='listings.asp'>¥ì©ö¨ú
response.write doc
end if
Function newstr(str)
newstr = Replace(Replace(str,"'","'
End function
%>
response.write sql
try add a response.end there to do debugging, like:
....
response.write sql
response.end
then check that generated sql statement and see if you missing some values there, and check the field data types make sure the values are in correct type as well.
try add a response.end there to do debugging, like:
....
response.write sql
response.end
then check that generated sql statement and see if you missing some values there, and check the field data types make sure the values are in correct type as well.
ASKER
Changed the code as per jplevyak suggestions but still get the same error:
Microsoft JET Database Engine error '80040e14'
Syntax error in UPDATE statement.
/admin/listing2updX.asp, line 52
new code is:
<%
Set adoCon=Server.CreateObject ("ADODB.Co nnection")
'Database connection info and provider
strCon = "Provider=Microsoft.Jet.OL EDB.4.0;Da ta Source=" &_
Server.MapPath("/data\db1. mdb") & ";"
nokey=request.querystring( "lid")
Set rs=Server.CreateObject("AD ODB.Record set")
rs.open "Select * from list2 where key=" & nokey , strCon, 3
wpass=rs("key")
if wpass <> request.form("address") then
sql= "update list2"
sql= sql & " set area ='" & request.form("area") & "',"
sql= sql & " county='" & Request.form("county") & "',"
sql= sql & " address='" &request.form("address")&" ',"
sql= sql & " city='" &request.form("city")&"',"
sql= sql & " state='" &request.form("state")&"', "
sql= sql & " zip='" &request.form("zip")&"',"
sql= sql & " price='" &request.form("price")&"', "
sql= sql & " mls='" &request.form("mls#")&"',"
sql= sql & " class='" &request.form("class")&"', "
sql= sql & " status='" &request.form("status")&"' ,"
sql= sql & " mlsarea='" &request.form("mlsarea")&" ',"
sql= sql & " ele1='" &request.form("ele1")&"',"
sql= sql & " junior1='" &request.form("junior1")&" ',"
sql= sql & " high1='" &request.form("high1")&"', "
sql= sql & " sqft='" &request.form("sqft")&"',"
sql= sql & "yrbuilt='" &request.form("yrbuilt")&" ',"
sql= sql & " tax='" &request.form("tax")&"',"
sql= sql & " taxyear='" &request.form("taxyear")&" ',"
sql= sql & " bed='" &request.form("bed")&"',"
sql= sql & " bath='" &request.form("bath")&"',"
sql= sql & " lrms='" &request.form("lrms")&"',"
sql= sql & " garage='" &request.form("garage")&"' ,"
sql= sql & " fplace='" &request.form("fplace")&"' , "
sql= sql & " pool='" &request.form("pool")&"',"
sql= sql & " exp='" &newstr(request.form("exp" ))&"',"
sql= sql & " upd='" &now&"',"
sql= sql & " input='" &request.form("city")&"',"
sql= sql & " rem='" &request.form("address")&" ',"
sql= sql & " flag='" &request.form("address")&" '"
sql = sql & " where key =" & request.querystring("lid")
'response.write sql
'response.end
adoCon.Open(strCon)
adoCon.Execute(sql)
adoCon.close
set adoCon=nothing
rs.close
set rs=nothing
strCon.close
set strCon=nothing
response.redirect "listingsfortest.asp"
else
response.write " <center>¨¬n©ö¨¢©ö©ªE¡Ì¡Æ¢® ¨¡©÷¢¬©ø¢¥I¢¥U. <br>"
response.write alert & " ¥ì©ö¨ú¨¡¡Æ¢®¨ù¨ù¢¯a......< br>"
doc="<a href='listings.asp'>¥ì©ö¨ú ¨¡¡Æ¢®¡¾a< /a>"
response.write doc
end if
Function newstr(str)
newstr = Replace(Replace(str,"'","' '"),CHR(34 ),""" )
End function
%>
Also added ryancys suggestion and result is:
update list2 set area ='Austin', county='travis', address='1401 N Weston Lane', city='Austin', state='TX', zip='78733', price='2995000', mls='', class='House', status='Active', mlsarea='8E', ele1='westlake', junior1='westlake', high1='westlake', sqft='7500',yrbuilt='1999' , tax='23000', taxyear='2003', bed='5', bath='3.5', lrms='5', garage='3', fplace='1', pool='1', exp='This wonderful waterfront retreat boasts approximately 5400 square feet, five bedrooms; four living, three and a half bath, plus flex room and a three car garage. Situated on over a 1.34 acre lot this paradise offers an abundance of scenic charm and casual elegance. Featuring a two stall boat dock with party deck and plenty of room for pool, this waterfront estate enjoys over130 feet of pristine lapping lake frontage. zzzzzzzzzzzzzzzzz ', upd='3/28/2006 6:29:51 AM', input='Austin', rem='1401 N Weston Lane', flag='1401 N Weston Lane' where key =103
Microsoft JET Database Engine error '80040e14'
Syntax error in UPDATE statement.
/admin/listing2updX.asp, line 52
new code is:
<%
Set adoCon=Server.CreateObject
'Database connection info and provider
strCon = "Provider=Microsoft.Jet.OL
Server.MapPath("/data\db1.
nokey=request.querystring(
Set rs=Server.CreateObject("AD
rs.open "Select * from list2 where key=" & nokey , strCon, 3
wpass=rs("key")
if wpass <> request.form("address") then
sql= "update list2"
sql= sql & " set area ='" & request.form("area") & "',"
sql= sql & " county='" & Request.form("county") & "',"
sql= sql & " address='" &request.form("address")&"
sql= sql & " city='" &request.form("city")&"',"
sql= sql & " state='" &request.form("state")&"',
sql= sql & " zip='" &request.form("zip")&"',"
sql= sql & " price='" &request.form("price")&"',
sql= sql & " mls='" &request.form("mls#")&"',"
sql= sql & " class='" &request.form("class")&"',
sql= sql & " status='" &request.form("status")&"'
sql= sql & " mlsarea='" &request.form("mlsarea")&"
sql= sql & " ele1='" &request.form("ele1")&"',"
sql= sql & " junior1='" &request.form("junior1")&"
sql= sql & " high1='" &request.form("high1")&"',
sql= sql & " sqft='" &request.form("sqft")&"',"
sql= sql & "yrbuilt='" &request.form("yrbuilt")&"
sql= sql & " tax='" &request.form("tax")&"',"
sql= sql & " taxyear='" &request.form("taxyear")&"
sql= sql & " bed='" &request.form("bed")&"',"
sql= sql & " bath='" &request.form("bath")&"',"
sql= sql & " lrms='" &request.form("lrms")&"',"
sql= sql & " garage='" &request.form("garage")&"'
sql= sql & " fplace='" &request.form("fplace")&"'
sql= sql & " pool='" &request.form("pool")&"',"
sql= sql & " exp='" &newstr(request.form("exp"
sql= sql & " upd='" &now&"',"
sql= sql & " input='" &request.form("city")&"',"
sql= sql & " rem='" &request.form("address")&"
sql= sql & " flag='" &request.form("address")&"
sql = sql & " where key =" & request.querystring("lid")
'response.write sql
'response.end
adoCon.Open(strCon)
adoCon.Execute(sql)
adoCon.close
set adoCon=nothing
rs.close
set rs=nothing
strCon.close
set strCon=nothing
response.redirect "listingsfortest.asp"
else
response.write " <center>¨¬n©ö¨¢©ö©ªE¡Ì¡Æ¢®
response.write alert & " ¥ì©ö¨ú¨¡¡Æ¢®¨ù¨ù¢¯a......<
doc="<a href='listings.asp'>¥ì©ö¨ú
response.write doc
end if
Function newstr(str)
newstr = Replace(Replace(str,"'","'
End function
%>
Also added ryancys suggestion and result is:
update list2 set area ='Austin', county='travis', address='1401 N Weston Lane', city='Austin', state='TX', zip='78733', price='2995000', mls='', class='House', status='Active', mlsarea='8E', ele1='westlake', junior1='westlake', high1='westlake', sqft='7500',yrbuilt='1999'
Are you able to copy and paste the above statement into Access' Query Builder to run it, and see which part is actually error? As mentioned, make sure the values submitted matched the fields data type.
ok....first. You have this wrong Server.MapPath("/data\db1. mdb")<-=no t a valid path
ASKER
if this was an invalid path I would receive the following message:
Microsoft JET Database Engine error '80004005'
'\\xxxx\xxxx\xxxx\xxxx\xxx x\xx.xxxxx \xxxxx\dat a\db1.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
/admin/listing2updfortest. asp, line 19
xxxx replace actual directories on server.
The path is valid because the form displays the data from the database.
Microsoft JET Database Engine error '80004005'
'\\xxxx\xxxx\xxxx\xxxx\xxx
/admin/listing2updfortest.
xxxx replace actual directories on server.
The path is valid because the form displays the data from the database.
ASKER
The post to the access data base from the Querry builder was successful on a local machine.
so seeing as how you are not willing to try it. I will just keep my ideas to myself (even though I have made the same mistake before, and it has errored out on me)
good luck to you
good luck to you
ASKER
I did try it...thank you for you assistance. The host also provided me with this path Server.MapPath("/data\db1. mdb"). When changing it to either "data\db1.mdb" or "\data\db1.mdb" I get the above error.
hmmm.... I noticed that adoCon is not open, try this
replace:
<%
Set adoCon=Server.CreateObject ("ADODB.Co nnection")
'Database connection info and provider
strCon = "Provider=Microsoft.Jet.OL EDB.4.0;Da ta Source=" &_
Server.MapPath("/data\db1. mdb") & ";"
nokey=request.querystring( "lid")
Set rs=Server.CreateObject("AD ODB.Record set")
with:
<%
Set adoCon=Server.CreateObject ("ADODB.Co nnection")
'Database connection info and provider
strCon = "Provider=Microsoft.Jet.OL EDB.4.0;Da ta Source=" &_
Server.MapPath("/data\db1. mdb") & ";"
adoCon.open strCon
nokey=request.querystring( "lid")
Set rs=Server.CreateObject("AD ODB.Record set")
also replace:
rs.close
set rs=nothing
strCon.close
set strCon=nothing
with this:
rs.close
set rs=nothing
strCon.close
set strCon=nothing
adoCon.close
set adoCon = nothing
replace:
<%
Set adoCon=Server.CreateObject
'Database connection info and provider
strCon = "Provider=Microsoft.Jet.OL
Server.MapPath("/data\db1.
nokey=request.querystring(
Set rs=Server.CreateObject("AD
with:
<%
Set adoCon=Server.CreateObject
'Database connection info and provider
strCon = "Provider=Microsoft.Jet.OL
Server.MapPath("/data\db1.
adoCon.open strCon
nokey=request.querystring(
Set rs=Server.CreateObject("AD
also replace:
rs.close
set rs=nothing
strCon.close
set strCon=nothing
with this:
rs.close
set rs=nothing
strCon.close
set strCon=nothing
adoCon.close
set adoCon = nothing
ASKER
new code suggestion produced this error:
ADODB.Connection error '800a0e79'
Operation is not allowed when the object is open.
/admin/listing2updX.asp, line 57
changed code posted below:
<%
Set adoCon=Server.CreateObject ("ADODB.Co nnection")
'Database connection info and provider
strCon = "Provider=Microsoft.Jet.OL EDB.4.0;Da ta Source=" &_
Server.MapPath("/data\db1. mdb") & ";"
adoCon.open strCon
nokey=request.querystring( "lid")
Set rs=Server.CreateObject("AD ODB.Record set")
nokey=request.querystring( "lid")
Set rs=Server.CreateObject("AD ODB.Record set")
rs.open "Select * from list2 where key=" & nokey , strCon, 3
wpass=rs("key")
if wpass <> request.form("address") then
sql= "update list2"
sql= sql & " set area ='" & request.form("area") & "',"
sql= sql & " county='" & Request.form("county") & "',"
sql= sql & " address='" &request.form("address")&" ',"
sql= sql & " city='" &request.form("city")&"',"
sql= sql & " state='" &request.form("state")&"', "
sql= sql & " zip='" &request.form("zip")&"',"
sql= sql & " price='" &request.form("price")&"', "
sql= sql & " mls='" &request.form("mls#")&"',"
sql= sql & " class='" &request.form("class")&"', "
sql= sql & " status='" &request.form("status")&"' ,"
sql= sql & " mlsarea='" &request.form("mlsarea")&" ',"
sql= sql & " ele1='" &request.form("ele1")&"',"
sql= sql & " junior1='" &request.form("junior1")&" ',"
sql= sql & " high1='" &request.form("high1")&"', "
sql= sql & " sqft='" &request.form("sqft")&"',"
sql= sql & "yrbuilt='" &request.form("yrbuilt")&" ',"
sql= sql & " tax='" &request.form("tax")&"',"
sql= sql & " taxyear='" &request.form("taxyear")&" ',"
sql= sql & " bed='" &request.form("bed")&"',"
sql= sql & " bath='" &request.form("bath")&"',"
sql= sql & " lrms='" &request.form("lrms")&"',"
sql= sql & " garage='" &request.form("garage")&"' ,"
sql= sql & " fplace='" &request.form("fplace")&"' , "
sql= sql & " pool='" &request.form("pool")&"',"
sql= sql & " exp='" &newstr(request.form("exp" ))&"',"
sql= sql & " upd='" &now&"',"
sql= sql & " input='" &request.form("city")&"',"
sql= sql & " rem='" &request.form("address")&" ',"
sql= sql & " flag='" &request.form("address")&" '"
sql = sql & " where key =" & request.querystring("lid")
response.write sql
'response.end
adoCon.Open(strCon)
adoCon.Execute(sql)
rs.close
set rs=nothing
strCon.close
set strCon=nothing
adoCon.close
set adoCon = nothing
response.redirect "listingsfortest.asp"
else
response.write " <center>¨¬n©ö¨¢©ö©ªE¡Ì¡Æ¢® ¨¡©÷¢¬©ø¢¥I¢¥U. <br>"
response.write alert & " ¥ì©ö¨ú¨¡¡Æ¢®¨ù¨ù¢¯a......< br>"
doc="<a href='listings.asp'>¥ì©ö¨ú ¨¡¡Æ¢®¡¾a< /a>"
response.write doc
end if
Function newstr(str)
newstr = Replace(Replace(str,"'","' '"),CHR(34 ),""" )
End function
%>
ADODB.Connection error '800a0e79'
Operation is not allowed when the object is open.
/admin/listing2updX.asp, line 57
changed code posted below:
<%
Set adoCon=Server.CreateObject
'Database connection info and provider
strCon = "Provider=Microsoft.Jet.OL
Server.MapPath("/data\db1.
adoCon.open strCon
nokey=request.querystring(
Set rs=Server.CreateObject("AD
nokey=request.querystring(
Set rs=Server.CreateObject("AD
rs.open "Select * from list2 where key=" & nokey , strCon, 3
wpass=rs("key")
if wpass <> request.form("address") then
sql= "update list2"
sql= sql & " set area ='" & request.form("area") & "',"
sql= sql & " county='" & Request.form("county") & "',"
sql= sql & " address='" &request.form("address")&"
sql= sql & " city='" &request.form("city")&"',"
sql= sql & " state='" &request.form("state")&"',
sql= sql & " zip='" &request.form("zip")&"',"
sql= sql & " price='" &request.form("price")&"',
sql= sql & " mls='" &request.form("mls#")&"',"
sql= sql & " class='" &request.form("class")&"',
sql= sql & " status='" &request.form("status")&"'
sql= sql & " mlsarea='" &request.form("mlsarea")&"
sql= sql & " ele1='" &request.form("ele1")&"',"
sql= sql & " junior1='" &request.form("junior1")&"
sql= sql & " high1='" &request.form("high1")&"',
sql= sql & " sqft='" &request.form("sqft")&"',"
sql= sql & "yrbuilt='" &request.form("yrbuilt")&"
sql= sql & " tax='" &request.form("tax")&"',"
sql= sql & " taxyear='" &request.form("taxyear")&"
sql= sql & " bed='" &request.form("bed")&"',"
sql= sql & " bath='" &request.form("bath")&"',"
sql= sql & " lrms='" &request.form("lrms")&"',"
sql= sql & " garage='" &request.form("garage")&"'
sql= sql & " fplace='" &request.form("fplace")&"'
sql= sql & " pool='" &request.form("pool")&"',"
sql= sql & " exp='" &newstr(request.form("exp"
sql= sql & " upd='" &now&"',"
sql= sql & " input='" &request.form("city")&"',"
sql= sql & " rem='" &request.form("address")&"
sql= sql & " flag='" &request.form("address")&"
sql = sql & " where key =" & request.querystring("lid")
response.write sql
'response.end
adoCon.Open(strCon)
adoCon.Execute(sql)
rs.close
set rs=nothing
strCon.close
set strCon=nothing
adoCon.close
set adoCon = nothing
response.redirect "listingsfortest.asp"
else
response.write " <center>¨¬n©ö¨¢©ö©ªE¡Ì¡Æ¢®
response.write alert & " ¥ì©ö¨ú¨¡¡Æ¢®¨ù¨ù¢¯a......<
doc="<a href='listings.asp'>¥ì©ö¨ú
response.write doc
end if
Function newstr(str)
newstr = Replace(Replace(str,"'","'
End function
%>
you have:
nokey=request.querystring( "lid")
Set rs=Server.CreateObject("AD ODB.Record set")
posted twice, so you can get rid of one of the extra ones.
also, replace:
adoCon.Open(strCon)
adoCon.Execute(sql)
with:
adoCon.Execute(sql)
nokey=request.querystring(
Set rs=Server.CreateObject("AD
posted twice, so you can get rid of one of the extra ones.
also, replace:
adoCon.Open(strCon)
adoCon.Execute(sql)
with:
adoCon.Execute(sql)
ASKER
made changes and now receive this error
Microsoft JET Database Engine error '80040e14'
Syntax error in UPDATE statement.
/admin/listing2updX.asp, line 53
code is below:
<%
Set adoCon=Server.CreateObject ("ADODB.Co nnection")
'Database connection info and provider
strCon = "Provider=Microsoft.Jet.OL EDB.4.0;Da ta Source=" &_
Server.MapPath("/data\db1. mdb") & ";"
adoCon.open strCon
nokey=request.querystring( "lid")
Set rs=Server.CreateObject("AD ODB.Record set")
rs.open "Select * from list2 where key=" & nokey , strCon, 3
wpass=rs("key")
if wpass <> request.form("address") then
sql= "update list2"
sql= sql & " set area ='" & request.form("area") & "',"
sql= sql & " county='" & Request.form("county") & "',"
sql= sql & " address='" &request.form("address")&" ',"
sql= sql & " city='" &request.form("city")&"',"
sql= sql & " state='" &request.form("state")&"', "
sql= sql & " zip='" &request.form("zip")&"',"
sql= sql & " price='" &request.form("price")&"', "
sql= sql & " mls='" &request.form("mls#")&"',"
sql= sql & " class='" &request.form("class")&"', "
sql= sql & " status='" &request.form("status")&"' ,"
sql= sql & " mlsarea='" &request.form("mlsarea")&" ',"
sql= sql & " ele1='" &request.form("ele1")&"',"
sql= sql & " junior1='" &request.form("junior1")&" ',"
sql= sql & " high1='" &request.form("high1")&"', "
sql= sql & " sqft='" &request.form("sqft")&"',"
sql= sql & "yrbuilt='" &request.form("yrbuilt")&" ',"
sql= sql & " tax='" &request.form("tax")&"',"
sql= sql & " taxyear='" &request.form("taxyear")&" ',"
sql= sql & " bed='" &request.form("bed")&"',"
sql= sql & " bath='" &request.form("bath")&"',"
sql= sql & " lrms='" &request.form("lrms")&"',"
sql= sql & " garage='" &request.form("garage")&"' ,"
sql= sql & " fplace='" &request.form("fplace")&"' , "
sql= sql & " pool='" &request.form("pool")&"',"
sql= sql & " exp='" &newstr(request.form("exp" ))&"',"
sql= sql & " upd='" &now&"',"
sql= sql & " input='" &request.form("city")&"',"
sql= sql & " rem='" &request.form("address")&" ',"
sql= sql & " flag='" &request.form("address")&" '"
sql = sql & " where key =" & request.querystring("lid")
' response.write sql
'response.end
adoCon.Execute(sql)
rs.close
set rs=nothing
strCon.close
set strCon=nothing
adoCon.close
set adoCon = nothing
response.redirect "listingsfortest.asp"
else
response.write " <center>¨¬n©ö¨¢©ö©ªE¡Ì¡Æ¢® ¨¡©÷¢¬©ø¢¥I¢¥U. <br>"
response.write alert & " ¥ì©ö¨ú¨¡¡Æ¢®¨ù¨ù¢¯a......< br>"
doc="<a href='listings.asp'>¥ì©ö¨ú ¨¡¡Æ¢®¡¾a< /a>"
response.write doc
end if
Function newstr(str)
newstr = Replace(Replace(str,"'","' '"),CHR(34 ),""" )
End function
%>
Microsoft JET Database Engine error '80040e14'
Syntax error in UPDATE statement.
/admin/listing2updX.asp, line 53
code is below:
<%
Set adoCon=Server.CreateObject
'Database connection info and provider
strCon = "Provider=Microsoft.Jet.OL
Server.MapPath("/data\db1.
adoCon.open strCon
nokey=request.querystring(
Set rs=Server.CreateObject("AD
rs.open "Select * from list2 where key=" & nokey , strCon, 3
wpass=rs("key")
if wpass <> request.form("address") then
sql= "update list2"
sql= sql & " set area ='" & request.form("area") & "',"
sql= sql & " county='" & Request.form("county") & "',"
sql= sql & " address='" &request.form("address")&"
sql= sql & " city='" &request.form("city")&"',"
sql= sql & " state='" &request.form("state")&"',
sql= sql & " zip='" &request.form("zip")&"',"
sql= sql & " price='" &request.form("price")&"',
sql= sql & " mls='" &request.form("mls#")&"',"
sql= sql & " class='" &request.form("class")&"',
sql= sql & " status='" &request.form("status")&"'
sql= sql & " mlsarea='" &request.form("mlsarea")&"
sql= sql & " ele1='" &request.form("ele1")&"',"
sql= sql & " junior1='" &request.form("junior1")&"
sql= sql & " high1='" &request.form("high1")&"',
sql= sql & " sqft='" &request.form("sqft")&"',"
sql= sql & "yrbuilt='" &request.form("yrbuilt")&"
sql= sql & " tax='" &request.form("tax")&"',"
sql= sql & " taxyear='" &request.form("taxyear")&"
sql= sql & " bed='" &request.form("bed")&"',"
sql= sql & " bath='" &request.form("bath")&"',"
sql= sql & " lrms='" &request.form("lrms")&"',"
sql= sql & " garage='" &request.form("garage")&"'
sql= sql & " fplace='" &request.form("fplace")&"'
sql= sql & " pool='" &request.form("pool")&"',"
sql= sql & " exp='" &newstr(request.form("exp"
sql= sql & " upd='" &now&"',"
sql= sql & " input='" &request.form("city")&"',"
sql= sql & " rem='" &request.form("address")&"
sql= sql & " flag='" &request.form("address")&"
sql = sql & " where key =" & request.querystring("lid")
' response.write sql
'response.end
adoCon.Execute(sql)
rs.close
set rs=nothing
strCon.close
set strCon=nothing
adoCon.close
set adoCon = nothing
response.redirect "listingsfortest.asp"
else
response.write " <center>¨¬n©ö¨¢©ö©ªE¡Ì¡Æ¢®
response.write alert & " ¥ì©ö¨ú¨¡¡Æ¢®¨ù¨ù¢¯a......<
doc="<a href='listings.asp'>¥ì©ö¨ú
response.write doc
end if
Function newstr(str)
newstr = Replace(Replace(str,"'","'
End function
%>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
did your suggestions, here is the response
update list2 set (area ='Austin', county='', address='1401 N Weston Lane', city='Austin', state='TX', zip='78733', price='2995000', mls='', class='House', status='Active', mlsarea='', ele1='', junior1='', high1='', sqft='', yrbuilt='', tax='', taxyear='2003', bed='5', bath='3.5', lrms='', garage='3', fplace='1', pool='', exp='This wonderful waterfront retreat boasts approximately 5400 square feet, five bedrooms; four living, three and a half bath, plus flex room and a three car garage. Situated on over a 1.34 acre lot this paradise offers an abundance of scenic charm and casual elegance. Featuring a two stall boat dock with party deck and plenty of room for pool, this waterfront estate enjoys over130 feet of pristine lapping lake frontage. zzzzzzzzzzzz ', upd='3/31/2006 7:52:41 AM', input='Austin', rem='1401 N Weston Lane', flag='1401 N Weston Lane') where key =103
zzzzzzzzzzzzz is what was updated.
when I comment out the response.write sql and response.end the error is
Microsoft JET Database Engine error '80040e14'
Syntax error in UPDATE statement.
/admin/listing2updX.asp, line 53
update list2 set (area ='Austin', county='', address='1401 N Weston Lane', city='Austin', state='TX', zip='78733', price='2995000', mls='', class='House', status='Active', mlsarea='', ele1='', junior1='', high1='', sqft='', yrbuilt='', tax='', taxyear='2003', bed='5', bath='3.5', lrms='', garage='3', fplace='1', pool='', exp='This wonderful waterfront retreat boasts approximately 5400 square feet, five bedrooms; four living, three and a half bath, plus flex room and a three car garage. Situated on over a 1.34 acre lot this paradise offers an abundance of scenic charm and casual elegance. Featuring a two stall boat dock with party deck and plenty of room for pool, this waterfront estate enjoys over130 feet of pristine lapping lake frontage. zzzzzzzzzzzz ', upd='3/31/2006 7:52:41 AM', input='Austin', rem='1401 N Weston Lane', flag='1401 N Weston Lane') where key =103
zzzzzzzzzzzzz is what was updated.
when I comment out the response.write sql and response.end the error is
Microsoft JET Database Engine error '80040e14'
Syntax error in UPDATE statement.
/admin/listing2updX.asp, line 53
response.write sql
strCon.Execute(sql)
The problem is the code is trying to execute a sql statement from a connection string variable. The Execute method needs to be called from your Connection object variable, adoCon, but make sure you open this connection using your string first:
adoCon.Open(strCon)
adoCon.Execute(sql)
Also need to fix clean up statements:
adoCon.close
set adoCon=nothing