AccessDB

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
radosamo
Posts: 1
Joined: Mon 25 Jan 2010 13:11

AccessDB

Post by radosamo » Wed 19 Oct 2011 15:28

How can I create new AccessDB and table with UniDac components.
I have D2010.

Thank you.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 20 Oct 2011 06:56

Hello,

At the moment UniDAC does not allow creating MS Access databases. We will consider adding this possibility in one of the future versions. Now you can create a database on your own using the following code:

Code: Select all

uses comobj,sysutils; 

............

function CreateAccessDatabase(FileName : String) : String; 
var cat : OLEVariant; 
begin 
result := ''; 
try 
  cat := CreateOleObject('ADOX.Catalog'); 
  cat.create ('Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+Filename+';'); 
  cat := NULL; 
except 
  on e : Exception do result := e.message; 
end; 
end;

Post Reply