Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp updating to database

Status
Not open for further replies.

krappleby

Programmer
Jul 25, 2006
25
GB
the following script i am using to update records to a Access database,

********************************************

<HTML>

<Head>

<Title>K.R.App web design</Title>

</Head>

<%
set conn = Server.CreateObject(&quot;Adodb.connection&quot;)

conn.Open &quot;customeraccounts.mdb&quot;

query = &quot;UPDATE IPdetails SET Address=&quot; & Request.QueryString(&quot;Address&quot;)
& &quot; WHERE Autonumber= &quot; & Request.QueryString(&quot;Autonumber&quot;)&quot;

conn.Execute(query)

Response.write &quot;Data updated&quot;
%>

<Body>

</Body>

</HTML>

*****************************************************

the parameters are sent from the previous page, to this one, however, whenever i try to run this script it comes up with, error on page......

any ideas

thanks
 


krappleby,

In your sql statement, if your variables for querystring have spaces in them, you need to enclose them in quotes.


query = &quot;UPDATE IPdetails SET Address='&quot; & Request.QueryString(&quot;Address&quot;) & &quot;'&quot;
& &quot; WHERE Autonumber='&quot; & Request.QueryString(&quot;Autonumber&quot;) & &quot;'&quot;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top