Re: ADO exception with character combination inside string...
- From: "Steve Zimmelman" <skz@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 20 Sep 2006 20:03:18 -0500
Try setting:
AdoQuery.ParamCheck := False ;
-Steve-
"Bo Berglund" <bo.berglund@xxxxxxxxx> wrote in message
news:2pf3h29gtafh6kjgt7ltskumu4i8mhoec1@xxxxxxxxxx
On Wed, 20 Sep 2006 20:10:46 +0200, Bo Berglund
<bo.berglund@xxxxxxxxx> wrote:
The rule for database exception seems to be:
- string contains a " character
- Somewhere after the " there is also a : character
Further investigation shows this to be a problem inside the TADOQuery
component. We have used this extensively throughout our application so
we are now in a tight spot...
The test we did was to use the TADOconnection like this (with the
Northwind database):
procedure TForm1.btnModifyClick(Sender: TObject);
var
SQLString: string;
begin
try
SQLString := 'UPDATE Categories SET [Description] = ''' +
edData.Text + ''' WHERE CategoryID = 4';
connADO.ConnectionString := 'Provider=SQLOLEDB.1;Integrated
Security=SSPI;Persist Security Info=False;Initial
Catalog=Northwind;Data Source=POLARIS';
connADO.Open;
connADO.Execute(SQLString); <== This always works fine.
qryADO.SQL.Clear;
qryADO.SQL.Add(SQLString);
qryADO.ExecSQL; <== This fails for the condition above
connADO.Close;
except
on E: Exception do
MessageDlg('Error:'#13 + E.Message, mtError, [mbOK],0);
end;
end;
The exception message when the error occurs is this:
"Parameter object is improperly defined. Inconsistent or incomplete
information was provided"
Notice that the exception *only* occurs if the edData.Text string
contains somewhere first a " char and later a : char.
In all other cases the text will be stored in the database!
Please help....
.
- Follow-Ups:
- Re: ADO exception with character combination inside string...
- From: Bo Berglund
- 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
- ADO exception with character combination inside string...
- Prev by Date: Re: ADO exception with character combination inside string...
- Next by Date: Re: ADO exception with character combination inside string...
- 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
|