Incorrect syntax near keyword default



Hi all,

I have a problem with two-tier application, that uses ADO components (Delphi
7) to connect to MS SQL server 2000.

I have switched from BDE to ADO componets (on BDE it worked fine).

I have a delphi procedure that updates some fields in a table that is
processed after I insert new record. (sql text with parameters in dummy
clientdataset :query->provider->clientdataset)

When I execute update statement, I get (on some machines) "EoleException
Incorrect syntax near keyword default".
I don't use "default" word in sql statement.

This error appear in the middle of my procedure, some sql statements execute
with no errors and they use same parameters.

I have updated to MDAC 2.7, but the error still appears.


Code:
procedure datamodule.UpdateRACU(DataSet:TDataSet)//inserted row
begin
with cdsDUMMY do begin
...

Close;
Params.Clear; IndexName := '';
CommandText := 'UPDATE RACU SET SKVREDASIT = ISNULL((SELECT
SUM(RS.CENASIT*RS.KOLI)'+
' FROM RACUA RS, RACU RA'+
' WHERE RS.RACU = RA.RACU
AND'+
' RS.DAKN = RA.DAKN AND'+
' RA.RACU= :RACU1 AND'+
' RA.DAKN= :DAKN1 ),0)'+
' WHERE RACU= :RACU2 AND'+
' DAKN= :DAKN2';
Params.ParseSQL(CommandText,True);
Params.ParamByName('RACU1').AssignFieldValue(cdsRACURACU,DataSet.FieldByName('RACU').AsInteger);
Params.ParamByName('DAKN1').AssignFieldValue(cdsRACUDAKN,DataSet.FieldByName('DAKN').AsDateTime);
Params.ParamByName('RACU2').AssignFieldValue(cdsRACURACU,DataSet.FieldByName('RACU').AsInteger);
Params.ParamByName('DAKN2').AssignFieldValue(cdsRACUDAKN,DataSet.FieldByName('DAKN').AsDateTime);
Execute;

// OK

Close;
Params.Clear; IndexName := '';
CommandText := 'UPDATE RACU SET SKVREDAEU = ISNULL((SELECT
SUM(RS.CENAEU*RS.KOLI)'+
' FROM RACUA RS, RACU RA'+
' WHERE RS.RACU = RA.RACU
AND'+
' RS.DAKN = RA.DAKN AND'+
' RA.RACU= :RACU1 AND'+
' RA.DAKN= :DAKN1 ),0)'+
' WHERE RACU= :RACU2 AND'+
' DAKN= :DAKN2';
Params.ParseSQL(CommandText,True);MyCorrectParseSQL(cdsDUMMY);
Params.ParamByName('RACU1').AssignFieldValue(cdsRACURACU,DataSet.FieldByName('RACU').Value);
Params.ParamByName('DAKN1').AssignFieldValue(cdsRACUDAKN,DataSet.FieldByName('DAKN').Value);
Params.ParamByName('RACU2').AssignFieldValue(cdsRACURACU,DataSet.FieldByName('RACU').Value);
Params.ParamByName('DAKN2').AssignFieldValue(cdsRACUDAKN,DataSet.FieldByName('DAKN').Value);
Execute;

//ERROR
...

end;
end;


Did anyone had similar problem with ADO ?

Regards Milos


.



Relevant Pages

  • Re: group and sort by month / site
    ... i'll try to start from scratch using the BDE view perhaps? ... "Gary Walter" wrote: ... "part of an aggregate function" because ... From your SQL, it should look like: ...
    (microsoft.public.access.queries)
  • Re: reindexing DBF files
    ... Tquery means BDE. ... SQL commands for reindexing DBF files via the BDE. ... So I want to reindex all the dbf tables first, ...
    (alt.comp.lang.borland-delphi)
  • Ntext Field Not Read by BDE
    ... that does SQL Quering on the SQL table. ... I ended up determining that it was not the ODBC connection, ... speaking the BDE either (although it only works on the MSSQL Driver, ... ntext field within it. ...
    (microsoft.public.sqlserver.server)
  • Re: SQL -> Oracle
    ... > with BDE (using regular TQuery and TDatabase). ... MS SQL 2007 won't provide SQL links which work with the BDE... ... > automatically converts query texts from SQL to Oracle? ...
    (borland.public.delphi.non-technical)
  • SQL 2000 Timeout Issues Since Converting from BDE to ADO
    ... multi-user application which runs against either SQL ... 2000 or Oracle which we recently converted to ADO from BDE. ... application to use ADO basically by converting the BDE components to ADO ...
    (borland.public.delphi.database.ado)