J
Joe_Black
Hi all,
Using Access 2003, Visual studio.net 2003
I want to allow a user to insert an apostrophe into a text field within
a database, the problem is I get an error when I do this via ado.net,
also if I directly type the text into the field within the table with
the apostrophe in it, then use the data in that field to perform a
search on another table I get an error about a badly formed SQL
statement i.e.
Data in field = "user can't move"
SQL search = "select * from atable where afield = 'user can't move'"
the database see's the apostrophe within the can't as the end of the
text to search on.
I was wondering is the a simple way to get around this problem, my
client seems to love using the apostophe . Or do I have to take every
string, parse it for the apostrophe character, then add the backslash
character before it to indicate that it truly is an apostrophe within
the text and not a text delimeter for the SQL statement. this ways seems
a bit long winded for something so simple.
Also is this the only way to insert the apostrophe character into a
field via ado.net?
TIA
Joe
Using Access 2003, Visual studio.net 2003
I want to allow a user to insert an apostrophe into a text field within
a database, the problem is I get an error when I do this via ado.net,
also if I directly type the text into the field within the table with
the apostrophe in it, then use the data in that field to perform a
search on another table I get an error about a badly formed SQL
statement i.e.
Data in field = "user can't move"
SQL search = "select * from atable where afield = 'user can't move'"
the database see's the apostrophe within the can't as the end of the
text to search on.
I was wondering is the a simple way to get around this problem, my
client seems to love using the apostophe . Or do I have to take every
string, parse it for the apostrophe character, then add the backslash
character before it to indicate that it truly is an apostrophe within
the text and not a text delimeter for the SQL statement. this ways seems
a bit long winded for something so simple.
Also is this the only way to insert the apostrophe character into a
field via ado.net?
TIA
Joe