Einzelnen Beitrag anzeigen

mjustin

Registriert seit: 14. Apr 2008
3.005 Beiträge
 
Delphi 2009 Professional
 
#1

InterBase 2009, UTF8 und dbExpress

  Alt 17. Mai 2010, 11:39
Datenbank: InterBase • Version: 2009 • Zugriff über: dbExpress
Hallo,

hat hier eventuell schon jemand Erfahrung mit dieser Kombination (InterBase 2009, UTF8 und dbExpress)?

Es gibt beim Ausführen eines Updates über diese Komponenten

SQLConnection -> SQLQuery -> DataSetProvider -> ClientDataSet -> DataSource -> DBEdit

den Fehler "Datensatz nicht gefunden oder von einem anderen Benutzer geändert"

Ein direktes Update über eine TSQLQuery dagegen funktioniert.

Der Delphi - Code besteht aus zwei Button-OnClick Handlern

Delphi-Quellcode:
ClientDataSet1.Open;
ClientDataSet1.Edit;
und

Delphi-Quellcode:
ClientDataSet1.Post;
ClientDataSet1.ApplyUpdates(-1);
sowie dem OnReconcile Handler

Delphi-Quellcode:
procedure TMainForm.ClientDataSet1ReconcileError(DataSet: TCustomClientDataSet;
  E: EReconcileError; UpdateKind: TUpdateKind; var Action: TReconcileAction);
begin
  ShowMessage('Reconcile ' + E.Message);
end;
Update: anscheinend bin ich auf einen alten Bug gestossen, der in Delphi 2010 Update 4 endlich gefixt ist:

http://qc.embarcadero.com/wc/qcmain.aspx?d=71984

Zitat:
When I pull some data into a TClientDataset using a Provider with UpdateMode := upWhereAll, and then i apply updates to a changed record: If some of the string fields in the record being updated are blank (but not null) I get "Record not found or changed by another user" because the update statement is sending `where myStringField is null` instead of `where myStringField = ""`
Der Fehler ist mit WIN1252 Feldern jedoch nicht aufgetreten, fragt mich nicht warum ...

Nachtrag:

Statt zwei Quotes

BindText := '(' + BindTextField + ' is null or ' + BindTextField + ' = "") and'; // <-- Quotes you use will depend on your SQL server. für InterBase mit 4 Apostroph:

BindText := '(' + BindTextField + ' is null or ' + BindTextField + ' = '''') and'; // <-- Quotes you use will depend on your SQL server.
Michael Justin
  Mit Zitat antworten Zitat