|
-
Nov 17th, 2003, 05:54 PM
#1
Thread Starter
Fanatic Member
Create DB without Access
I found a tutorial one time that showed an example of how to create a MS Access DB with a vb app but the user did not have to have Access installed on their machine.
Can someone provide an example or explanation of this or maybe point me toward some info.
Any help is appreciated,
JO
"I have not failed. I've just found 10,000 ways that won't work."
'Thomas Edison'
"If we knew what it was we were doing it wouldn't be called research, would it?"
'Albert Einstein'
VB6
-
Nov 17th, 2003, 07:09 PM
#2
-= B u g S l a y e r =-
it is correct, ms access do not have to be installed.
you can use ADO and ADOX in order to retreive, view and edit data, and also to maintain and create databases.
sample
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
-
Nov 17th, 2003, 07:11 PM
#3
-= B u g S l a y e r =-
-
Nov 17th, 2003, 09:21 PM
#4
Thread Starter
Fanatic Member
Thats great info!
I am familiar with ado but with existing databases.
Thanks for the info!
"I have not failed. I've just found 10,000 ways that won't work."
'Thomas Edison'
"If we knew what it was we were doing it wouldn't be called research, would it?"
'Albert Einstein'
VB6
-
Nov 18th, 2003, 01:34 AM
#5
-= B u g S l a y e r =-
-
Nov 19th, 2003, 08:52 PM
#6
Frenzied Member
And you can use DAO too. Just search the help files.
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
|