Autor Beitrag
Soulama
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72



BeitragVerfasst: Fr 21.10.05 14:34 
Hallo zusammen,
ich möchte per Code eine MS Access Datenbank erstellen:
ausblenden 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:
function CreateAccessMDB(Filename: string): boolean;
var
   DBEngine: OLEVariant;
   DBLocale: string;
   strbuf:   array[0..20] of char;
begin
   try
      { connect to MS Jet DB Engine... }
      DBEngine := CreateOLEObject('DAO.DBEngine.35');
      { get locale info for creating database... }
      GetLocaleInfo(LOCALE_USER_DEFAULT,LOCALE_IDEFAULTLANGUAGE,strbuf,20);
      DBLocale := ';LANGID=0x'+strbuf;     { language code as C-style hex   integer (0x0809 for UK English) }
      GetLocaleInfo(LOCALE_USER_DEFAULT,LOCALE_IDEFAULTCODEPAGE,strbuf,20);
      DBLocale := DBLocale+';CP='+strbuf;  { default code page (850 for UK  English) }
      GetLocaleInfo(LOCALE_USER_DEFAULT,LOCALE_IDEFAULTCOUNTRY,strbuf,20);
      DBLocale := DBLocale+';COUNTRY='+strbuf;      { country code (44 for UK English) }
      DBEngine.CreateDatabase(Filename,DBLocale);
      Result := true;
   except
      on EOleException do
         Result := false;
   end;
end;

hab aber die Fehlermeldung:
cant load DLL: MSJTER35.DLL.
kennt jemand diesen Fehler zufällig ?

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt
MagicAndre1981
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 21.10.05 14:41 
ausblenden Delphi-Quelltext
1:
DBEngine := CreateOLEObject('DAO.DBEngine.35');					


Da willst ein DataAcessObject version 3.5 erstellen. Sind die Komponneten bei deinem Windows nicht installiert? Warum nimmst du nicht die ADO-Komponenten aus Delphi, oder hats du nur die Personal?

[Edit]

Kannst du bitte die Delphi-tags setzen, anstatt CODE-Tags.

[/Edit]
Soulama Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72



BeitragVerfasst: Fr 21.10.05 14:43 
Hi,
hab Delphi 7 entreprise, aber mit welcher ADO Kpmponente kann ich eine MS Access Datenbank
erstellen?
MagicAndre1981
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 21.10.05 14:54 
Nimm eine ADOCommand und pack den SQL-Befehl (CREATE DATABASE) rein.
Soulama Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72



BeitragVerfasst: Fr 21.10.05 15:46 
Hi,
1: gibt es kein Befehl: Create Database unter Access
2: Die AdoCommand Komponente braucht eine AdConnection, die eine Datenbank braucht.
Ich muss sagen dass ich deine Antwort nicht verstanden habe.
Könntest Du mir vielleicht besser erklären :!:
MagicAndre1981
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 21.10.05 15:58 
Och, da muss ich nochmal Delphi installieren und darauf hab ich im Moment keinen Bock :?

Hast du die DLL auf deinem Rechner?

[Edit]

Googlen hilf machmal auch ;-)

delphi.about.com/od/...base/l/aa072401b.htm

www.efg2.com/Lab/Library/Delphi/ADO/

www.swissdelphicente...showcode.php?id=2297

[/edit]