Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Creating a database at runtime

Posted on 2001-06-25
4
Medium Priority
?
166 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 1

Accepted Solution

by:
bnemmers earned 200 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

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…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

618 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