SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 26th, 2002, 12:59 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Update command and sigle quotes

<i><b>Originally posted by : RG (rgonzales66@attbi.com)</b></i><br />what do I need to escape single quotes in side of a request record set here is the SQL statment I am using but a tick inside of any of the filds causes a error "Syntax error (missing operator) in query expression" ... of corse if you use two single quotes it will update the record<br /><br />SQLstmt = "UPDATE articles SET "_<br />& "title = '" & request("title") & "', " _<br />& "body = '" & request("body") & "', " _<br />& "blurb = '" & request("blurb") & "', " _<br />& "author = '" & request("author") & "' " _<br />& "WHERE (id = " & ID & ")"<br /><br />Set rs = conn.execute(SQLstmt)<br />

Reply With Quote
  #2  
Old May 28th, 2002, 06:29 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Paolo Marini (the_hobbit30@hotmail.com)</b></i><br />Just substitute every<br />Request("field")<br />with<br />Replace(Request("field"), "'", "''")<br /><br />Bye<br /><br /><br />------------<br />RG at 5/26/2002 10:59:16 AM<br /><br />what do I need to escape single quotes in side of a request record set here is the SQL statment I am using but a tick inside of any of the filds causes a error "Syntax error (missing operator) in query expression" ... of corse if you use two single quotes it will update the record<br /><br />SQLstmt = "UPDATE articles SET "_<br />& "title = '" & request("title") & "', " _<br />& "body = '" & request("body") & "', " _<br />& "blurb = '" & request("blurb") & "', " _<br />& "author = '" & request("author") & "' " _<br />& "WHERE (id = " & ID & ")"<br /><br />Set rs = conn.execute(SQLstmt)<br />

Reply With Quote
  #3  
Old May 28th, 2002, 06:32 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Paolo Marini (the_hobbit30@hotmail.com)</b></i><br />It's not so readable...<br />The second parameter for the Replace function is "'", that is a single quote.<br />The third parameter is a "''", that is a single quote repeated twice.<br /><br /><br />------------<br />Paolo Marini at 5/28/2002 4:29:37 PM<br /><br />Just substitute every<br />Request("field")<br />with<br />Replace(Request("field"), "'", "''")<br /><br />Bye<br /><br /><br />------------<br />RG at 5/26/2002 10:59:16 AM<br /><br />what do I need to escape single quotes in side of a request record set here is the SQL statment I am using but a tick inside of any of the filds causes a error "Syntax error (missing operator) in query expression" ... of corse if you use two single quotes it will update the record<br /><br />SQLstmt = "UPDATE articles SET "_<br />& "title = '" & request("title") & "', " _<br />& "body = '" & request("body") & "', " _<br />& "blurb = '" & request("blurb") & "', " _<br />& "author = '" & request("author") & "' " _<br />& "WHERE (id = " & ID & ")"<br /><br />Set rs = conn.execute(SQLstmt)<br />

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Update command and sigle quotes


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT