Solved

Creating MDB Database in Code...

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

825 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