ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP 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 April 10th, 2000, 08:38 AM
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
thanks o lot guys but my code is still not working here is the code can somebody look into it

<i><b>Originally posted by : venkatesh krishnamurthy (venky33@hotmail.com)</b></i><br />here is the html file<br /><html><br /><br /><head><br /><meta http-equiv="Content-Language" content="en-us"><br /><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><br /><meta name="GENERATOR" content="Microsoft FrontPage 4.0"><br /><meta name="ProgId" content="FrontPage.Editor.Document"><br /><title>CATEGORY</title><br /></head><br /><br /><body bgcolor="#FFDCE0"><br /><br /><form name="newcategory" action="insertnewebc1.asp" method="POST"><br /> <table border="0" width="61%" cellspacing="0" cellpadding="0"><br /> <tr><br /> <td width="23%"><b><font color="#000080">CATEGORY</font></b></td><br /> <td width="2%" align="center"><b><font color="#000080">:</font></b></td><br /> <td width="75%"><input type="text" name="category" size="20"></td><br /> </tr><br /> <tr><br /> <td width="23%"><b><font color="#000080">SUBCATEGORY</font></b></td><br /> <td width="2%" align="center"><b><font color="#000080">:</font></b></td><br /> <td width="75%"><input type="text" name="subcategory" size="20"></td><br /> </tr><br /> <tr><br /> <td width="100%" colspan="3"><br /> <p align="center"><input type="submit" value="Insert" name="B1"><input type="reset" value="Clear" name="B2"></td><br /> </tr><br /> </table><br /></form><br /><br /><p align="left"><a href="menu1.htm">BACK</a></p><br /><br /></body><br /><br /></html><br />here is the asp code<br /><html><br /><!--#include file="db.inc"--><br /><head> <br /><base target="main"><br /><title>educationalbookcentre</title><br /></head><br /><body bgcolor=#FFDCE0><br /><%<br />Dim var1<br />Dim var2<br />Dim var3<br />var1 = UCase(Request.form("category"))<br />var2 = UCase(Request.form("subcategory"))<br />var3 = ""'"&Subcategories&"'""<br />Conn.Execute "insert into test1(CATEGORY,SUBCATEGORY) values('"&var1&"','"&var3&"')"<br />Conn.Execute "insert into test1(CATEGORY,SUBCATEGORY) values('"&var1&"','"&var2&"')"<br />Response.Write("One Record Inserted")%><br><br /><A href="newcategory.htm">BACK</A><br><br /><A href="main.htm">BACK To Main Page</A><br /><%Conn.close<br />set Conn=nothing %></body></html><br />and db.inc file<br /><%<br />db=server.mappath("ebc.mdb")<br /><br />connStr = "DBQ=" & db & ";Driver={Microsoft"<br />connStr = connStr & " Access Driver (*.mdb)}"<br />set Conn = server.createobject("adodb.connection")<br />Conn.open connStr<br />%><br />actually i want to insert an single quote and there is a problem with concatination in the asp file can somebody help<br />bye<br /><br />

Reply With Quote
  #2  
Old April 11th, 2000, 03:24 AM
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 : antony (antovelan@usa.net)</b></i><br />thats very simple, before inserting into sQL statement replace u'r single quote by double quote by using following function<br /><br />function doublequote(sqlp)<br />doublequote=replace(sqlp,"'","''")<br />end function<br /><br />now change u'r program sligtly<br /><br />-------------------------<br />changed program by antony<br />-------------------------<br />change var1,var2,var3 into<br /><br /><br />var1=doublequote(request.....)<br />var2=doublequote(request.....)<br />like etc...<br /><br /><html><br /><br /><head><br /><meta http-equiv="Content-Language" content="en-us"><br /><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><br /><meta name="GENERATOR" content="Microsoft FrontPage 4.0"><br /><meta name="ProgId" content="FrontPage.Editor.Document"><br /><title>CATEGORY</title><br /></head><br /><br /><body bgcolor="#FFDCE0"><br /><br /><form name="newcategory" action="insertnewebc1.asp" method="POST"><br /> <table border="0" width="61%" cellspacing="0" cellpadding="0"><br /> <tr><br /> <td width="23%"><b><font color="#000080">CATEGORY</font></b></td><br /> <td width="2%" align="center"><b><font color="#000080">:</font></b></td><br /> <td width="75%"><input type="text" name="category" size="20"></td><br /> </tr><br /> <tr><br /> <td width="23%"><b><font color="#000080">SUBCATEGORY</font></b></td><br /> <td width="2%" align="center"><b><font color="#000080">:</font></b></td><br /> <td width="75%"><input type="text" name="subcategory" size="20"></td><br /> </tr><br /> <tr><br /> <td width="100%" colspan="3"><br /> <p align="center"><input type="submit" value="Insert" name="B1"><input type="reset" value="Clear" name="B2"></td><br /> </tr><br /> </table><br /></form><br /><br /><p align="left"><a href="menu1.htm">BACK</a></p><br /><br /></body><br /><br /></html><br />here is the asp code<br /><html><br /><!--#include file="db.inc"--><br /><head> <br /><base target="main"><br /><title>educationalbookcentre</title><br /></head><br /><body bgcolor=#FFDCE0><br /><%<br />Dim var1<br />Dim var2<br />Dim var3<br />var1 = doblequote(UCase(Request.form("category")))<br />var2 = doblequote(UCase(Request.form("subcategory")))<br />var3 = doublequote(""'"&Subcategories&"'"")<br />Conn.Execute "insert into test1(CATEGORY,SUBCATEGORY) values('"&var1&"','"&var3&"')"<br />Conn.Execute "insert into test1(CATEGORY,SUBCATEGORY) values('"&var1&"','"&var2&"')"<br />Response.Write("One Record Inserted")%><br><br /><A href="newcategory.htm">BACK</A><br><br /><A href="main.htm">BACK To Main Page</A><br /><%Conn.close<br />set Conn=nothing %></body></html><br />and db.inc file<br /><%<br />db=server.mappath("ebc.mdb")<br /><br />connStr = "DBQ=" & db & ";Driver={Microsoft"<br />connStr = connStr & " Access Driver (*.mdb)}"<br />set Conn = server.createobject("adodb.connection")<br />Conn.open connStr<br />%><br />actually i want to insert an single quote and there is a problem with concatination in the asp file can somebody help<br />bye<br /><br />

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > thanks o lot guys but my code is still not working here is the code can somebody look into it


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