|
-
Jan 10th, 2002, 12:31 PM
#1
Using ADO to create a database (solved)
I give up. I've looked for 2 hours now,
how do you create a new database (not a table) in ADO?
also, how do I delete this thread because my stupid *($#&*#$& is so slow I hit the submit button twice?
-
Jan 10th, 2002, 02:13 PM
#2
What database type are you trying to create?? Access, SQL Server, Oracle, Sybase ?
-
Jan 10th, 2002, 04:22 PM
#3
Hyperactive Member
Use ADOX
VB Code:
Dim catADO As ADOX.Catalog
catADO.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=TestDatabase.mdb"
for details see my site...
Graham, www.gab2001uk.com VBExplorer Forum Moderator VBExplorer
www.gab2001uk.com For comparing and contrasting DAO with ADO
Code for Creating, Copying, Compacting, Replicating, Synchronising Access 97/2000 databases plus showing Schemas and using .Seek
-
Jan 10th, 2002, 05:01 PM
#4
Only works when the string is explicit:
Code:
Dim catADO As ADOX.Catalog
Dim str_Temp As String
Set catADO = New ADOX.Catalog
catADO.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\xsxx.mdb"
works fine, but
Code:
Dim catADO As ADOX.Catalog
Dim str_Temp As String
Set catADO = New ADOX.Catalog
str_Temp = "Provider=Microsft.Jet.OLEDB.4.0;Data Source=c:\xsxx.mdb"
catADO.Create (str_Temp)
gets an error: Class not registered
Any ideas?
-
Jan 10th, 2002, 06:38 PM
#5
Hyperactive Member
If it is just the name of the new db you want to change then
VB Code:
Dim catADO As ADOX.Catalog
Dim str_Temp As String
Set catADO = New ADOX.Catalog
str_Temp = "c:\xsxx.mdb"
catADO.Create "Provider=Microsft.Jet.OLEDB.4.0;Data Source=" & str_Temp
Graham, www.gab2001uk.com VBExplorer Forum Moderator VBExplorer
www.gab2001uk.com For comparing and contrasting DAO with ADO
Code for Creating, Copying, Compacting, Replicating, Synchronising Access 97/2000 databases plus showing Schemas and using .Seek
-
Jan 10th, 2002, 07:06 PM
#6
PowerPoster
Or see your chit chat thread!
I answered it there!
later
b
-
Jan 11th, 2002, 07:55 AM
#7
I'm an idiot.
I'm dumber than snails.
I talk to squirrels.
I can't spell MICROSOFT.
That's the error in the above. The word Microsoft in the connection string is spelled MICROSFT.
damn machines.
-
Jan 11th, 2002, 09:17 AM
#8
Hyperactive Member
Oh dear...
Perhaps we should have looked at the obvious first.
Graham, www.gab2001uk.com VBExplorer Forum Moderator VBExplorer
www.gab2001uk.com For comparing and contrasting DAO with ADO
Code for Creating, Copying, Compacting, Replicating, Synchronising Access 97/2000 databases plus showing Schemas and using .Seek
-
Jan 11th, 2002, 10:23 AM
#9
We did Gab. It's just that looking for your own errors in spelling is difficult under the best of circumstances. That's why a good editor is more precious than a good author.
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
|