|
-
Feb 15th, 2004, 05:06 AM
#1
Thread Starter
New Member
Create New database at runtime
Hi,
Is it possible to create a new database at the runtime?
If yes how and if not why?
Thanks
-
Feb 15th, 2004, 02:13 PM
#2
Re: Create New database at runtime
Originally posted by junk
Hi,
Is it possible to create a new database at the runtime?
If yes how and if not why?
Thanks
Search for ADOX you will find many examples here..
http://www.vbforums.com/search.php?s...ost&sortorder=
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Feb 16th, 2004, 01:23 AM
#3
-= B u g S l a y e r =-
VB Code:
'Add a reference to Microsoft ADO Ext. X.X For DLL And Security
Option Explicit
Dim cat As ADOX.Catalog
Dim tbl As ADOX.Table
Private Sub Command1_Click()
Set cat = New ADOX.Catalog
Set tbl = New ADOX.Table
' create the db
cat.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\newDB3.mdb"
With tbl
.Name = "TestTable"
' Create fields and append them to the
' Columns collection of the new Table object.
With .Columns
.Append "ID COLUMN"
.Append "SetName", adVarWChar, 255
.Append "SetVal", adVarWChar, 255
.Append "Description", adVarWChar, 255
End With
End With
' Add the new Table to the Tables collection of the database.
cat.Tables.Append tbl
'Set AllowZeroLength to true for the SetName field
tbl.Columns("SetName").Properties("Jet OLEDB:Allow Zero Length") = True
Set cat = Nothing
Set tbl = Nothing
End Sub
and yes.. you would proabaly find this when searcing
-
Apr 2nd, 2004, 04:05 PM
#4
Member
Just out of curiosity (and because of the project i'm working on as my semeser project for school) would this work in vb.net 2003? If not, how would i create a new access database in vb.net 2003? Oh yeah, i found this thread by searching
How come it's a penny for your thoughts, but you have to put your 2 cents in? Somebody's makin' a penny 
-
Apr 3rd, 2004, 05:05 AM
#5
-= B u g S l a y e r =-
Hi IceBreakerG,
this will NOT work in VB .Net.
You will have to use ADO .NET
Ask the question in the VB .NET forum, I'm suer some of the good people in that forum knows how to do this.
http://www.vbforums.com/forumdisplay.php?s=&forumid=25
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|