|
 |
asp_databases thread: Storing data into tables
Message #1 by mangal@i... on Tue, 18 Apr 2000 22:41:28
|
|
I am trying to save data into access database from a asp page text box. I
am using statement like
str=" insert into test_table(text_Box) values ('"& request.form("Textbox")
&"')".
It workes fine. But when I enter the characters like ",',! into
textbox. I get an error. Is there any other way to store text box data into
tables.
Thanks.
Mangal
Message #2 by "Ken Schaefer" <ken.s@a...> on Thu, 20 Apr 2000 12:51:58 +1000
|
|
You need to escape those reserved characters, eg replace each ' with two '
using the Replace() function. Same with "
eg
strText = Replace(Request.Form("Textbox"), "'", "''")
Cheers
Ken
----- Original Message -----
To: ASP Databases <asp_databases@p...>
Sent: Tuesday, April 18, 2000 10:41 PM
Subject: [asp_databases] Storing data into tables
> I am trying to save data into access database from a asp page text box. I
> am using statement like
>
> str=" insert into test_table(text_Box) values ('"& request.form("Textbox")
> &"')".
> It workes fine. But when I enter the characters like ",',! into
> textbox. I get an error. Is there any other way to store text box data
into
> tables.
>
> Thanks.
> Mangal
Message #3 by Mangal Nagarkar <Mangal@i...> on Thu, 20 Apr 2000 08:35:53 -0500
|
|
Thanks. It works
mangal
----Original Message-----
From: Ken Schaefer
Sent: Wednesday, April 19, 2000 9:52 PM
To: ASP Databases
Subject: [asp_databases] Re: Storing data into tables
You need to escape those reserved characters, eg replace
each ' with two ' using the Replace() function. Same with "
eg
strText = Replace(Request.Form("Textbox"), "'", "''")
Cheers
Ken
----- Original Message -----
To: ASP Databases <asp_databases@p...>
Sent: Tuesday, April 18, 2000 10:41 PM
Subject: [asp_databases] Storing data into tables
I am trying to save data into access database from a asp
page text box. I am using statement like str=" insert into
test_table(text_Box) values ('"& request.form("Textbox") &"')".
It workes fine. But when I enter the characters like ",',! into
textbox. I get an error. Is there any other way to store
text box data into tables.
Thanks.
Mangal
|
|
 |