Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 10th, 2004, 04:25 AM
Authorized User
 
Join Date: Feb 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to knight
Default update query doesnt work

my codes are under
------------------

<%if session("granted") = false then
        response.redirect("unauth.htm")
end if
ringname=request("ring_name")
desc=request("desc")
itemid=request("itemid")
dim objRS
set objRS = Server.CreateObject("ADODB.Recordset")
sql="update tblRings set name="&ringname&",desc="&desc&" where item_id = " &itemid
-->objRS.open sql,conn
objRS.close
set objRS=nothing
%>


when i check my query through response.write(sql)
its shows me
update tblRings set name=ring Ass,desc=gfhfhhfhfh where item_id = 9
whats wrong with this query pls help me
-----------
but my browser say

------------

Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'ring Ass'.
/jewler/admin/update_ring.asp, line 12


Browser Type:
Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)

Page:
POST 187 bytes to /jewler/admin/update_ring.asp

POST Data:
ring_name=ring+Ass&itemid=9&desc=gfhfhhfhfh&s1=on& s2=on&s3=on&s4=on&s5=on&s6=on&s7=on&s8=on&s9=on&s1 0=on&karat=&listing_data=6%2F10%2F2004+10%3A39%3A4 0+AM&price=222&opqty=22&Submit=Update

Time:
Thursday, June 10, 2004, 2:20:50 PM


More information:
Microsoft Support
 
Old June 10th, 2004, 05:55 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Modify the sql statement as:

sql="update tblRings set name='"&ringname&"',desc='"&desc&"' where item_id = " &itemid


Om Prakash
 
Old June 10th, 2004, 06:14 AM
Authorized User
 
Join Date: Feb 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to knight
Default

now error shown
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in UPDATE statement.
/jewler/admin/update_ring.asp, line 13

line 13 is--> objRS.open sql,conn

 
Old June 10th, 2004, 06:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

What does your SQL-statement look like now? (response.write(sql))

It could be the column name 'desc' that is the culprit - check this thread:
http://p2p.wrox.com/topic.asp?TOPIC_ID=14616


 
Old June 10th, 2004, 07:24 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Yes, Jonax is correct, the code should be as follows:

sql="update tblRings set name='"&ringname&"',[desc]='"&desc&"' where item_id = " &itemid

as desc is keyword.

Om Prakash





Similar Threads
Thread Thread Starter Forum Replies Last Post
c:out doesnt work tllcll JSP Basics 1 November 1st, 2007 03:15 AM
xsl:key doesnt work cristtiah XSLT 11 May 24th, 2006 09:57 AM
Button doesnt work help john111 Java GUI 4 March 21st, 2006 05:22 PM
ContainsValue doesnt work demitry Generics 1 November 21st, 2005 05:29 PM
WHY DOESNT THIS WORK vb certified Pro VB.NET 2002/2003 5 August 1st, 2005 11:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.