Re: ADO exception with character combination inside string...



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....





.



Relevant Pages

  • RfD: Escaped Strings S" (v6.3)
    ... Escape character is case sensitive, ... the S" string can only contain printable characters, ... impact of char in the file word sets. ...
    (comp.lang.forth)
  • [TOMOYO #15 3/8] Common functions for TOMOYO Linux.
    ... This file contains common functions (e.g. policy I/O, pattern matching). ... Since TOMOYO Linux is a name based access control, ... TOMOYO Linux's string manipulation functions make reviewers feel crazy, ... the Linux kernel accepts all characters but NUL character ...
    (Linux-Kernel)
  • Re: Invalid UNC path in my .NET applicaton
    ... I am having problems loading xml stored as a blob in an Oracle ... Exception Details: System.ArgumentException: The UNC path should be of ... System.IO.Path.nGetFullPathHelper(String path, Char[] ... String& newPath) +0 ...
    (microsoft.public.dotnet.framework)
  • Re: xmalloc string functions
    ... char *dup; ... tokis strtokthat takes a string argument instead of using a global. ... better though, would be an exception handling system, namely, we crash only if the out-of-memory exception goes unhandled. ... likely an unwinding handler would silently ignore any previous recursive handlers. ...
    (comp.lang.c)
  • Re: SoapException character encoding
    ... >> display the character. ... In binary format however, this is still the ... The string we're discussing is XML escaped, ... >> exception, ...
    (microsoft.public.dotnet.framework.webservices)