Solved

Creating a database at runtime

Posted on 2001-06-25
4
158 Views
Last Modified: 2010-04-06
I need code/class/ActiveX that I can use to create a database (files, table, fields, ...) at runtime. I need to create Microsoft JET databases using DAO/ADO at runtime. Is there any web site that has some free sapmles I can use?
0
Comment
Question by:bmatumbura
  • 3
4 Comments
 
LVL 1

Accepted Solution

by:
bnemmers earned 50 total points
ID: 6225707
Hi,

You don't list the database you would like to create, Access, MS SQL, Oracle etc..
Take a look at TADOCommand Object it allows DDL SQL commands.

Good luck
Bill.
0
 
LVL 11

Author Comment

by:bmatumbura
ID: 6227355
Hie Bill,

Can I use TADOCommand to create MS Access databases or I can only use it to connect to an existing database file (either directly or using a DSN)?

I need to the application to create the .mdb file, the tables, fields etc. like what VB's DAO engine does.
0
 
LVL 1

Expert Comment

by:bnemmers
ID: 6232271
Hi,

Sorry about the delay, I was out of town.
try this to create the Access db

procedure TForm1.Button1Click(Sender: TObject);
var
  ADOTest: Variant;
  ConnectStr: Variant;
begin
  ConnectStr := 'Provider=Microsoft.JET.OLEDB.4.0;Data source = c:\Test.mdb';
  ADOTest := CreateOleObject('ADOX.Catalog.2.5');
  ADOTest.Create(ConnectStr);
  ADOTest := '';
end;

Good luck
Bill
0
 
LVL 1

Expert Comment

by:bnemmers
ID: 6232348
Hi,

One more thing. you might want to download "OLE/COM Object Viewer" from Micro$oft.
It's a nice tool for looking at all com's loaded on your computer. Open "MSADOX.dll" this will
give you all Interfaces in ADOX

http://www.microsoft.com/com/resources/oleview.asp

Bill
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Intraweb submit form as a POST request 4 323
TServerSocket - file via sendbuf or Text via sendtext ? 1 65
Delphi...Split view - idea? 1 88
DBCtrlGrid, Delphi, Scroll 7 26
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 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