![]() |
IBDatabaseInfo->Wie?
Hallo, hab mal wieder ein Problem,
ich will am Anfang meines Progs einen Check einbauen, ob bestimmte Felder in der Datenbank vorhanden sind (für Programmerweiterungen/Updates). Dazu hab ich mir die IBDatabaseInfo-Kompo rausgesucht. Nach dem Connect, führe ich folgenden Code aus:
Delphi-Quellcode:
Dabei bekomm ich aber den Fehler "Datenbank nicht zugewiesen". Wie mach ichs richtig?
with IBDatabaseInfo1 do begin
* * *Database.GetFieldNames('Artikel',liste); * * *if liste.IndexOf('art')=-1 then * * *IBSQL.SQL.Text:='ALTER TABLE artikel ADD art integer DEFAULT 0 NOT NULL, ADD lager INTEGER DEFAULT 0, ADD bestellt integer DEFAULT 0;'; * * * * if Mainform.debug then* *//Debug-Modus???? * * * * * *if MessageDlg(IBSQL.SQL.Text,mtConfirmation,[mbOK,mbCancel],0)=mrCancel then * * * * * * * Exit; * * * * IBSQL.ExecQuery; * * * * Commit(Self); * * *end; Gruß |
hier ein Beispiel aus der FIBplus-Hilfe :
Delphi-Quellcode:
tja, mehr hab ich jetzt auch nicht.
procedure TForm1.Button1Click(Sender: TObject);
var I: Integer; begin with pFIBServerProperties1 do begin ServerName := 'Poulet'; LoginPrompt := False; Params.Add('user_name=sysdba'); Params.Add('password=masterkey'); Active := True; try Options := [Database]; FetchDatabaseInfo; Label1.Caption := 'Number of Attachments = ' + IntToStr(DatabaseInfo.NoOfAttachments); Label2.Caption := 'Number of Databases = ' + IntToStr(DatabaseInfo.NoOfDatabases); for I:= 0 to High(DatabaseInfo.DbName) do Memo1.Lines.Add(DatabaseInfo.DbName[i]); finally Active := False; end; end; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 13:33 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz