Re: ADO exception with character combination inside string...
- From: Bo Berglund <bo.berglund@xxxxxxxxx>
- Date: Thu, 21 Sep 2006 22:04:00 +0200
On Thu, 21 Sep 2006 12:16:21 -0500, "Kevin Frevert"
<kevin@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
"Bo Berglund" <bo.berglund@xxxxxxxxx> wrote in message
news:8ch5h2h6k6hel702grsadrd62u4qqrgv3d@xxxxxxxxxx
On 21 Sep 2006 07:28:33 -0700, "Bill Todd" <no@xxxxxx> wrote:
Enclose TNC:\CHARLIE in single quotes. Any database that follows the
SQL standard will assume that a string enclosed in double quotes is a
quoted identifier (table name, field name, etc.) not a string literal.
The string being sent as SQL is composed like this:
SQL := 'UPDATE Categories SET [Description] = ''' + edData.Text + '''
WHERE CategoryID = 4';
Just curious, is there a reason why you are not using parameters? Are there
safeguards protecting the application from SQL injection?
We don't know for what we would like to use parameters at all....
For performance and isolation reasons we have put all of our logic
into stored procedures inside the MSSQL database. This means that the
applications (there are several) that operate on the database always
use calls to the stored procedures in order to update data or retrieve
recordsets from it.
We only send the parameters in like this simplified example:
SQL := 'EXEC UpdateOrderByID @OrderID=5123, @Name=''Ericsson 1652K'',
@Description=''My description string''';
qryADO.Execute(SQL);
All of the needed actions inside the database (might be multiple
dependencies that need update in the real case) will be controlled by
the extremely well tested stored procedure. In case there are
cross-table data with various kinds of joins, these too are controlled
by the stored procedures. So there is no way a mistake by a programmer
will completely trash the database contents.
And we gain the speed advantage of running the logic inside MSSQL too.
But of course things like the order description are user entered data
and they might well enter a file path (as in the case we got) as a
part of some description. We were very surprised that the SQL string
was not directly passed to the database.
After all we have been working with ADO and MSSQL since about 6 years
by now (switched from MS Access)....
Only goes to show that you never know everything about anything.
/Bo
.
- Follow-Ups:
- Re: ADO exception with character combination inside string...
- From: Kevin Frevert
- Re: ADO exception with character combination inside string...
- References:
- ADO exception with character combination inside string...
- From: Bo Berglund
- Re: ADO exception with character combination inside string...
- From: Bo Berglund
- Re: ADO exception with character combination inside string...
- From: Brian Bushay TeamB
- Re: ADO exception with character combination inside string...
- From: Bo Berglund
- Re: ADO exception with character combination inside string...
- From: Bill Todd
- Re: ADO exception with character combination inside string...
- From: Bo Berglund
- Re: ADO exception with character combination inside string...
- From: Kevin Frevert
- ADO exception with character combination inside string...
- Prev by Date: TADOQuery Error Handling
- Next by Date: Re: Delphi 6 - ADO - MS SQL Server
- Previous by thread: Re: ADO exception with character combination inside string...
- Next by thread: Re: ADO exception with character combination inside string...
- Index(es):
Relevant Pages
|
Loading