A
adamrdrew
I am Developing ASP database admin tool for company's intranet. On one
of our websites has a press release section, that data for which is
stored in a SQL database running MSSQLServer 2000. The table for this
data contains, the author of the press release, the date it was
written, the URL to point to for the release and the title of the
release.I am writing a util that allows a user to add press releases
without coming to me. Development for the util went smooth until I
uncoverd an unforseen problem, When writing new data to the table in
order to update it, any apostrophes cause errors, because the SQL
statement sees it like this (UPDATE TableName SET Title = 'Investor's
Business daily') the apostrophe causes a termination for the string
Investor's Business Daily. I could inform the user base not to use
apostrophes, but that would make me a @#$%ing horrible developer. I
want to know If anyone has found away around this, that does not
involve parsing the data, and replacing the ' with '' I could write
such a routine, but it would be hell on earth due to the way that I
coded the rest of the app. I am using ASP with VBSCRIPT as my scripting
language. The data is presented to the user in a form, All of the data
from the Database is dumped into the form, the user can edit it, and
then hit save. When the user hit's save, it runs an ASP page, that
takes the data posted to it by the aformentioned form and writes that
new data to the table. That's where the problem is, because though It
can grab the apostophe's just fine, and they can be in the table. I
cannot pass them to the table, as it causes string termination. I am at
my wits end. I have never posted on a mesaage board before for help. I
was hoping some one might have an answere.
Thank You,
Adam Drew
of our websites has a press release section, that data for which is
stored in a SQL database running MSSQLServer 2000. The table for this
data contains, the author of the press release, the date it was
written, the URL to point to for the release and the title of the
release.I am writing a util that allows a user to add press releases
without coming to me. Development for the util went smooth until I
uncoverd an unforseen problem, When writing new data to the table in
order to update it, any apostrophes cause errors, because the SQL
statement sees it like this (UPDATE TableName SET Title = 'Investor's
Business daily') the apostrophe causes a termination for the string
Investor's Business Daily. I could inform the user base not to use
apostrophes, but that would make me a @#$%ing horrible developer. I
want to know If anyone has found away around this, that does not
involve parsing the data, and replacing the ' with '' I could write
such a routine, but it would be hell on earth due to the way that I
coded the rest of the app. I am using ASP with VBSCRIPT as my scripting
language. The data is presented to the user in a form, All of the data
from the Database is dumped into the form, the user can edit it, and
then hit save. When the user hit's save, it runs an ASP page, that
takes the data posted to it by the aformentioned form and writes that
new data to the table. That's where the problem is, because though It
can grab the apostophe's just fine, and they can be in the table. I
cannot pass them to the table, as it causes string termination. I am at
my wits end. I have never posted on a mesaage board before for help. I
was hoping some one might have an answere.
Thank You,
Adam Drew