Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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 February 2nd, 2005, 11:44 AM
Authorized User
 
Join Date: Jun 2003
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default Apostrophes in sql statement

I am trying to do a report in asp but one of the options in the drop down list says "Citizen's Presentation" here is the statement:
SQL = SQL & " where file_type = '" & request("filetype") & "'"

and this is what appears in the browser using response.write
select * from tblAgendaItemDetail(nolock) where file_type = 'Citizen' order by file_number

I have tried everything to make this works but I cannot figure it out. Any help please I would appreciate. Thank you

slypunk
__________________
slypunk
 
Old February 2nd, 2005, 11:56 AM
Authorized User
 
Join Date: Jun 2003
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I also did this:

    SQL = SQL & " where file_type = '" & request("filetype") & "'''"

and in the browser it shows up as this:

select * from tblAgendaItemDetail(nolock) where file_type = 'Citizen''' order by file_number

and it still does not work. :(

slypunk
 
Old February 2nd, 2005, 03:48 PM
Authorized User
 
Join Date: Jun 2003
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can someone please tell me what I have to do I have to complete this by tomorrow.

Thanks sorry for the urgent request.

slypunk
 
Old February 2nd, 2005, 04:03 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please try:

SQL = SQL & " where file_type = '" & replace(request("filetype"),"'","''") & "'"

Om Prakash





Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid truncating field values with apostrophes jrobbins ASP.NET 1.0 and 1.1 Professional 3 December 4th, 2007 08:24 PM
convert a SQL Statement from MS Access to a SQL Corey Access 6 March 28th, 2007 12:33 PM
apostrophes or quotation marks crmpicco Javascript 6 March 21st, 2006 09:01 AM
issues with apostrophes darkhalf Classic ASP Databases 3 December 22nd, 2004 02:42 AM
Inserting apostrophes into an Access Dataabase mrideout BOOK: Beginning ASP.NET 1.0 2 September 10th, 2004 05:57 AM





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