Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create and delete database

Status
Not open for further replies.

simran1

Programmer
Apr 23, 2002
82
US
Hi,

I want to be able to create and delete a database with some tables dynamically through my VB program.
I am using this code to create a database
Code:
Dim DataDir As String
Dim ws As Object
Dim db As Object

DataDir = App.Path & "\Client.mdb"
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase(DataDir)
Set db = ws.CreateDatabase(DataDir, dbLangGeneral)

Set admintbl = db.CreateTableDef("Config")
Set fld = admintbl.CreateField("AdminPwd", dbText, 20)
admintbl.Fields.Append fld

Set fld = admintbl.CreateField("Wallpaper", dbText, 220)
admintbl.Fields.Append fld

db.TableDefs.Append admintbl
Is there a way to completly delete an existing database.
 
Take a look at the "Kill" statement If you choose to battle wits with the witless be prepared to lose.
[machinegun][hammer]

[cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top