Solved

Creating MDB Database in Code...

Posted on 2001-09-04
3
151 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

705 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

12 Experts available now in Live!

Get 1:1 Help Now