Autor Beitrag
MKehrer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 114

NT, 2000
D6
BeitragVerfasst: Mi 28.05.03 11:33 
Hi Delphianer,

Ich hab eine funktionierende Verbindung zu eine MySQL DB aus den ZEOS-Komp. (TZMySqlDatabase; TZMySqlTransact; TZMySqlQuery;) aufgebaut.

mit TZMySqlQuery.OpenSQL und .ExecSQL kann ich nach belieben meine DB lesen und schreiben.

Ich möchte mir allerdings auch die Möglichtkeit vorbehalten, die DB über die übliche DelphieSyntax zu beschreiben. Das müßte eigentlich so gehen
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
zqu:TZMySqlQuery
 
    zcn.Connect;
    zqu.SQL.Clear;
    zqu.SQL.Add('select ....');
    zqu.RequestLive:=true;
    zqu.Open;
    zqu.First;

  zqu.FieldValues['??????']:='irgendwas';
  zqu.ApplyUpdates;
  zqu.DisConnect;


Der Datensatz ist zwar geändert, wird aber nicht in die DB übertragen.
zqu.ApplyUpdates ruft die Proc. nur Post auf, wenn State in [dsEdit,dsInsert]. State ist aber dsBrowse und lässt sich natürlich nicht von Hand ändern. Proc. Post von Hand aufrufen geht auch nicht.

Wer weiß wie´s geht?

_________________
Manfred
Was Du siehst ist in Dir (Smile)
Luncustaf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Mi 28.05.03 11:38 
hi,

also netweder nimmst du die sql syntax mit UPDATE tabelle SET xx WHERE xxx = xxx bin mir net sicher ob das so 100% richtig is.

oder du nimmst die table komponente mir der ich das am liebsten amchen

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
table.tablename .= 'tabellenname';
table.open;
table.append;
table.fieldvalues['xxx'] := 'xxx';
table.post;
table.close;



gr€€tz
MKehrer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 114

NT, 2000
D6
BeitragVerfasst: Mi 28.05.03 12:22 
Es muß doch aber auch möglich sein über SQL-Anweisung einen editierbaren Datensatz zu erzeugen und den auch zurückzuschicken.

Bei ADO und der BDE geht das doch auch.

_________________
Manfred
Was Du siehst ist in Dir (Smile)
Luncustaf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Mi 28.05.03 12:30 
geht denke ich shcon ich mache es aber nie mit einem query auch net bei ado ;)

also insofern kann ich dir net helfen da ich damit kine erfahrung habe ;)

gr€€tz