- Details
- Written by: Stanko Milosev
- Category: dbExpress
- Hits: 6711
If you tried something like:
with cds1.Params do
begin
ParamByName('finish').AsDateTime := now;
ParamByName('start').AsDateTime := Now-1;
end;
cds1.Open
And you received error like: DBX Error - ParameterNotSet then don't use AsDateTime, use AsSQLTimeStamp := DateTimeToSQLTimeStamp(Now-1);, so your code should look like:
with cds1.Params do
begin
ParamByName('finish').AsSQLTimeStamp := DateTimeToSQLTimeStamp(now);
ParamByName('start').AsDateTime := DateTimeToSQLTimeStamp(Now-1);
end;
cds1.Open
- Details
- Written by: Stanko Milosev
- Category: dbExpress
- Hits: 6792
If you added DBXDynalink to your uses list, deployed:
dbxconnections.ini
dbxdrivers.ini
dbexpsda40.dll
Tried everything what is described here.
Then, try also:
ConnectionName = 'MYSQLCONNECTION'
DriverName = 'MySQL'
GetDriverFunc = 'getSQLDriverMYSQL'
LibraryName = 'dbexpmda.dll'
VendorLib = 'libmysql.dll'
- Details
- Written by: Stanko Milosev
- Category: dbExpress
- Hits: 6283
- Details
- Written by: Stanko Milosev
- Category: dbExpress
- Hits: 7083
Problem with dbExpress is that it does not raise an exception if anything is wrong in database (for example, if you try to add primary key which already exist). So, to get an exception, best would be to use OnReconcileError in TClientDataSet... Small example:
procedure Tdm.cdsReconcileError(DataSet: TCustomClientDataSet;
E: EReconcileError; UpdateKind: TUpdateKind; var Action: TReconcileAction);
begin
ShowMessage(e.Message);
end;