Solved

Creating MDB Database in Code...

Posted on 2001-09-04
3
152 Views
Last Modified: 2010-04-06
        I wonder if there?s anyway do create MDB Database in code with Delphi, say, Just Tell me how Create  Database ?MyDB.MDB?  in Folder ?C:\Database?. Show me an example of code, I?ll give you my points...

0
Comment
Question by:DOOM_DAEMON
3 Comments
 
LVL 1

Expert Comment

by:piscean
ID: 6453336
This site is just what you want bro ... You don't have to give me the credits ... (but you may if you like ...)

http://delphi.about.com/library/weekly/aa072401a.htm
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 6455901
a sample by paul sutton
(from my knowledgebase)

unit Mdb;

interface
uses
 Windows,ComObj, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
 StdCtrls;

procedure BldMdb(FileName:String);
implementation
const
 dbLangGeneral = ';LANGID=0x0409;CP=1252;COUNTRY=0';
 dbVersion30 = 32; {choose this for Access 95 database}
 dbEncrypt = 2;
var
 DBEngine: Variant;
 Workspace: Variant;

procedure BldMdb(FileName:String);

begin
 DBEngine := CreateOleObject('DAO.DBEngine.35');
 Workspace := DBEngine.Workspaces[0];
 Try
 Workspace.CreateDatabase(Filename, dbLangGeneral, dbEncrypt);
 Except
 end;
end;

end.

meikl ;-)
0
 
LVL 1

Author Comment

by:DOOM_DAEMON
ID: 6461159
        Thanks for ya, Piscean. I've finally found that you suggested a great site of delphi source. And Thanks kretzschmar  for your demonstration. You help me out!, you know?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now