Board index » delphi » how can I create an Access 2002 mdb format with ADO ?

how can I create an Access 2002 mdb format with ADO ?


2003-12-02 04:19:32 AM
delphi282
Hi ,
the code below works if I configure "access database default format" on
options of Access XP, otherwise this code create and Access 2000 mdb
I need to create access 2002 mdb on machines that don╢t have microsoft
access Xp installed...
Any help would be appreciated,
Thanks,
Guto.
function CreateDatabaseSample ( aFileName: String ):boolean;
var
ADOXCatalog : TADOXCatalog;
lConnStr : String;
begin
result := false;
lConnStr := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + aFileName
+ ';Jet OLEDB:Engine Type=4';
ADOXCatalog := TADOXCatalog(nil);
if Assigned( ADOXCatalog) then
try
ADOXCatalog.Create1(lConnStr);
result := true;
finally
FreeAndNil( ADOXCatalog );
end;
end;
 
 

Re:how can I create an Access 2002 mdb format with ADO ?

Jet OLEDB:Engine Type=5
Or just do not use this parameter - latest installed db type will be
created.
//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi + ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Guto" <XXXX@XXXXX.COM>сообщи?сообщила ?новостях следующе?
Quote
Hi ,

the code below works if I configure "access database default format" on
options of Access XP, otherwise this code create and Access 2000 mdb

I need to create access 2002 mdb on machines that don╢t have microsoft
access Xp installed...

Any help would be appreciated,

Thanks,

Guto.



function CreateDatabaseSample ( aFileName: String ):boolean;
var
ADOXCatalog : TADOXCatalog;
lConnStr : String;
begin
result := false;

lConnStr := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' +
aFileName
+ ';Jet OLEDB:Engine Type=4';

ADOXCatalog := TADOXCatalog(nil);
if Assigned( ADOXCatalog) then
try
ADOXCatalog.Create1(lConnStr);
result := true;
finally
FreeAndNil( ADOXCatalog );
end;
end;




 

Re:how can I create an Access 2002 mdb format with ADO ?

Guto <XXXX@XXXXX.COM>writes
XXXX@XXXXX.COM
Quote
Hi ,

the code below works if I configure "access database default format"
on options of Access XP, otherwise this code create and Access 2000
mdb
[...]
Quote
lConnStr := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' +
aFileName + ';Jet OLEDB:Engine Type=4';
A Jet Engine Type of 4 creates an Access 97 mdb. Use 5.
--
A: Top-posters.
Q: What is the most annoying thing on Usenet?
 

Re:how can I create an Access 2002 mdb format with ADO ?

Access 2000 and Access 2002 formats are equal. The difference is in system
tables that Access creates when database is open in MS Access. When you
create database with Jet those tables are not created.
//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi + ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Guto" <XXXX@XXXXX.COM>сообщи?сообщила ?новостях следующе?
Quote
Sorry, I wrote Type=4 but the my program is Type = 5

Jet OLEDB:Engine Type=5 still depends of default format (2000 or 2002) !
I
want to force access "2002"

Any help would be appreciated

please Help :)

Guto.

"Viatcheslav V. Vassiliev" <XXXX@XXXXX.COM>escreveu na mensagem
news:3fcba579$XXXX@XXXXX.COM...
>Jet OLEDB:Engine Type=5
>
>Or just do not use this parameter - latest installed db type will be
>created.
>
>//------------------------------------------
>Regards,
>Vassiliev V. V.
>www.managed-vcl.com - using .Net objects in Delphi + ADO.Net
>www.oledbdirect.com - The fastest way to access MS SQL Server,
>MS Jet (Access) and Interbase (through OLEDB)
>
>"Guto" <XXXX@XXXXX.COM>сообщи?сообщила ?новостях следующе?
>news:XXXX@XXXXX.COM...
>>Hi ,
>>
>>the code below works if I configure "access database default format"
on
>>options of Access XP, otherwise this code create and Access 2000 mdb
>>
>>I need to create access 2002 mdb on machines that don╢t have
microsoft
>>access Xp installed...
>>
>>Any help would be appreciated,
>>
>>Thanks,
>>
>>Guto.
>>
>>
>>
>>function CreateDatabaseSample ( aFileName: String ):boolean;
>>var
>>ADOXCatalog : TADOXCatalog;
>>lConnStr : String;
>>begin
>>result := false;
>>
>>lConnStr := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' +
>aFileName
>>+ ';Jet OLEDB:Engine Type=4';
>>
>>ADOXCatalog := TADOXCatalog(nil);
>>if Assigned( ADOXCatalog) then
>>try
>>ADOXCatalog.Create1(lConnStr);
>>result := true;
>>finally
>>FreeAndNil( ADOXCatalog );
>>end;
>>end;
>>
>>
>>
>>
>
>