Autor Beitrag
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: So 17.07.05 07:42 
Hallo, ich möchte information über eine MySQL DB auslesen und prüfe mit ZQuery.Fields.Fields[J].InheritsFrom(TAutoIncField) ob ein Feld
AutoInc ist! Aber er gibt mir immer False zurück! Wie prüfe ich das richtig?

Moderiert von user profile iconTino: "Hi Leute" aus dem Titel entfernt.
cherry
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 136

WinXP - Professional
RAD Studio 2009
BeitragVerfasst: Mi 20.07.05 14:24 
kannst du das nicht so herausfinden?!

ZQuery.Fields.Fields[J].FieldKind :roll:
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Mi 20.07.05 14:55 
user profile iconcherry hat folgendes geschrieben:
kannst du das nicht so herausfinden?!

ZQuery.Fields.Fields[J].FieldKind :roll:


Moment mal was bedeutet in diesem Fall FieldKind?
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 20.07.05 14:58 
Zitat:
Schon gut ich habe rausgefunden das man Fields[0].DataType = ftAutoInc abfragen muß!

Das ist von dir selbst in einem anderen Thread.
Ich denke, dass das bei ZQuery nicht viel anders sein wird.
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Mi 20.07.05 15:10 
user profile iconjasocul hat folgendes geschrieben:
Zitat:
Schon gut ich habe rausgefunden das man Fields[0].DataType = ftAutoInc abfragen muß!

Das ist von dir selbst in einem anderen Thread.
Ich denke, dass das bei ZQuery nicht viel anders sein wird.


Nein er liefert mir immer False! Also ich hatte vorher so gemacht

ZQuery.Fields[J].DataType = ftAutoInc aber allgemein ist ftAutoInc in der DB Unit als 32 Bit Zähler definiert aber
in meiner MySQL habe ich z.B. BigInt also 20 stellige Zahl glaub ich war das!

Später habe ich so geschrieben:

ZQuery.Fields.Fields[J] aber nicht im Zusammenhang mit DataType = ftAutoInc

und vorher

ZQuery.Fields[J] ist hier vieleicht der Unterschied?

Eigentlich habe ich von allen DataType gespeichert aber da sind eben die Zählfelder als Zahl einmal die 2 andermal die 6
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 20.07.05 15:20 
Definiere mal ein Feld als AutoInc in deiner Datenbank-Tabelle und lass dir dann in Delphi anzeigen, elchen Feld-Typ Delphi meint zu erkennen.
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Mi 20.07.05 16:41 
user profile iconjasocul hat folgendes geschrieben:
Definiere mal ein Feld als AutoInc in deiner Datenbank-Tabelle und lass dir dann in Delphi anzeigen, elchen Feld-Typ Delphi meint zu erkennen.


Das ist es ja! Ich habe AutoInc Felder drin und ich habe ja geschrieben wenn ich DataType abfrage
dann ist bei einem BIGINT Zählfeld Ord(DataType) = 6 und bei einem TINYINT Zählfeld Ord(DataType) = 2
damit wird also allein der Datentyp zurückgegeben und das AutoInc wird anders geprüft denke ich

ich habe es also mit Field[J] is TAutoIncField und FieldDefs[J].AutoGenerateValue = arAutoInc versucht
aber immer wieder False obwohl das Ergebnis eindeutig True sein muß!

Vieleicht muß man RequestLive = True setzen aber das wird wahrscheinlich keine Rolle spielen
oder man muß es mit ZSQLMedaData machen!

Na ja es gibt ein Zeos Forum werds mal suchen!
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Di 26.07.05 06:53