Autor Beitrag
Windoof
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34

Windows 95/98 SE/NT4.0 WS/2000 Professional/XP Home & Professional, SuSE Linux 7.0/9.0 Professional, OpenBSD
Dev-C++ 4.9.9.0, Borland C++ Builder 3 Personal/5 Professional/6 Enterprise, Borland Delphi 6 Enterprise/7 Enterprise
BeitragVerfasst: Di 11.01.05 14:31 
Hallo, ich wollte mal fragen, ob es möglich ist und wei groß der Aufwand ist, SQL auszuführen, ohne mit einer DB verbunden zu sein (mit Borland Delphi 6 Enterprise)...? Die BDE-Komponenten melden ja Fehler, wenn man das versucht... wie kann man das sonst noch machen?

- Windoof
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: Di 11.01.05 14:38 
Im ersten Moment dachte ich: Hääh? Wat soll denn dat?

Nach einigem Nachdenken vermute ich, dass du einen Syntaxprüfer für deine SQL-Statements haben möchtest. Liege ich da richtig? Falls nicht, weiß ich nicht, was du mit SQL ohne DB machen willst.
Windoof Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34

Windows 95/98 SE/NT4.0 WS/2000 Professional/XP Home & Professional, SuSE Linux 7.0/9.0 Professional, OpenBSD
Dev-C++ 4.9.9.0, Borland C++ Builder 3 Personal/5 Professional/6 Enterprise, Borland Delphi 6 Enterprise/7 Enterprise
BeitragVerfasst: Di 11.01.05 14:44 
NEin,das leider nicht, ich wollte in meiner Anwendung eine Datenbank erstellen, dazu brauche ich SQL, damit ich den Befehl "create database" ausführen kann. Wie kann ich das realisieren...?

_________________
C++ Club - Tomorrow we'll be your favourite!
*gleichnamige Website international*
Spieler1
ontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 469


D6 Pers
BeitragVerfasst: Di 11.01.05 14:52 
Vielleicht hilft dir SQLite? ;)
Aber ich weiß nicht, ob's das auch für Delphi gibt ...
Windoof Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34

Windows 95/98 SE/NT4.0 WS/2000 Professional/XP Home & Professional, SuSE Linux 7.0/9.0 Professional, OpenBSD
Dev-C++ 4.9.9.0, Borland C++ Builder 3 Personal/5 Professional/6 Enterprise, Borland Delphi 6 Enterprise/7 Enterprise
BeitragVerfasst: Di 11.01.05 14:54 
Wofür hast du es denn?

_________________
C++ Club - Tomorrow we'll be your favourite!
*gleichnamige Website international*
Popov
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1655
Erhaltene Danke: 13

WinXP Prof.
Bei Kleinigkeiten D3Pro, bei größeren Sachen D6Pro oder D7
BeitragVerfasst: Di 11.01.05 14:59 
Bei Interbase kannst du "create database" verwenden. Mich würde es auch nicht wundern wenn Access das auch bieten würde. MS SQL Server kann das auch ;) (es gibt eine Free Version des SQL Servers, der allerdings maximal 5 User gleichzeitig zuläßt).

Sonst würde ich ADO benutzen. Auch da kannst du mit SQL arbeiten.

_________________
Popov
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: Di 11.01.05 15:02 
Du brauchst natürlich schon einen Datenbank-Server. Sonst gibts ja nichts auf dem Rechner, was deine SQL-Befehle interpretieren kann.
Da gibt es verschiedene kostenlose. Wenn du im Forum nach Suche in: Delphi-Forum, Delphi-Library FIREBIRD oder Suche in: Delphi-Forum, Delphi-Library INTERBASE suchst dürftest du einige Treffer bekommen.
Windoof Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34

Windows 95/98 SE/NT4.0 WS/2000 Professional/XP Home & Professional, SuSE Linux 7.0/9.0 Professional, OpenBSD
Dev-C++ 4.9.9.0, Borland C++ Builder 3 Personal/5 Professional/6 Enterprise, Borland Delphi 6 Enterprise/7 Enterprise
BeitragVerfasst: Di 11.01.05 15:06 
Auf dem PC ist InterBase 6.0 drauf, also hab ich schon etwas... ich will nur wissen, wieich im Programm jetzt create database aufrufen kann... damit man nicht immer manuell Datenbanken anlegen muss...

_________________
C++ Club - Tomorrow we'll be your favourite!
*gleichnamige Website international*
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: Di 11.01.05 19:06 
So sieht zum Beispiel in einer älteren Routine das erstellen einer Datenbank mit ZEOS-Komponenten auf einer Interbase 6 Datenbank aus :

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
procedure TIBDataModule.DataModuleCreate(Sender: TObject);    
begin                                                         
  IBDatabaseConfig.LoginPrompt := false;
  if not (ReadFromRegistryString(regkey,'server_directory')='') then begin  
    IBDatabaseConfig.Host := ReadFromRegistryString(regkey,'server_name');  
    IBDatabaseConfig.Database := ReadFromRegistryString(regkey,'server_directory') + 'bisconfig.gdb'; 
    IBDatabaseConfig.Password := 'masterkey';
    IBDatabaseConfig.Login := 'SYSDBA';
    try
      IBTransactConfig.Connect;
    except
      IBDatabaseConfig.Database := ReadFromRegistryString(regkey,'server_directory') + 'bisconfig.gdb'; 
      IBDatabaseConfig.Password := 'masterkey';
      IBDatabaseConfig.Login := 'SYSDBA';
      IBDatabaseConfig.CreateDatabase('');
      with IBQueryCategory do begin
        Sql.Clear;
        Sql.Add('CREATE DOMAIN idzaehler AS SMALLINT;');
        ExecSql;
        Sql.Clear;
        Sql.Add('CREATE GENERATOR gAutoInc;');
        ExecSql;
        Sql.Clear;
        Sql.Add('SET GENERATOR gAutoInc TO 1;');
        ExecSql;
      end;
    end;                                                                   
    IBDBPostkorb.Host := ReadFromRegistryString(regkey,'server_name');     
    IBDBPostkorb.Database := ReadFromRegistryString(regkey,'server_directory') + 'bisbasket.gdb'; 
    IBDBPostkorb.Password := 'masterkey';
    IBDBPostkorb.Login := 'SYSDBA';
    try
      IBDBPostkorbTrans.Connect;
    except
      IBDBPostkorb.Database := ReadFromRegistryString(regkey,'server_directory') + 'bisbasket.gdb'; 
      IBDBPostkorb.Password := 'masterkey';
      IBDBPostkorb.Login := 'SYSDBA';
      IBDBPostkorb.CreateDatabase('');
    end;
  end;                                                                   
end;


Die Werte die aus der Regsitry ausgelesen werden, brauche ich nur um den Pfad für die Datenbank variable halten zu können.
Windoof Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34

Windows 95/98 SE/NT4.0 WS/2000 Professional/XP Home & Professional, SuSE Linux 7.0/9.0 Professional, OpenBSD
Dev-C++ 4.9.9.0, Borland C++ Builder 3 Personal/5 Professional/6 Enterprise, Borland Delphi 6 Enterprise/7 Enterprise
BeitragVerfasst: Mi 12.01.05 13:55 
Danke dir...

_________________
C++ Club - Tomorrow we'll be your favourite!
*gleichnamige Website international*