by James Olarte (8 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 14th December 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Function to create Database using ADO(ActiveX Data Objects). Good news for ADO Programmers. You only need to supply the path where to create
API Declarations
'You must add Microsoft ADO Ext. 2.7 for DDL and Security Reference
'I actually researched this since my thesis requires ADO Functions only
'You only need to supply the path like <app.path> then the DatabaseName <James.mdb>
'Feel free to use my code with ease.
On Error GoTo ErrorHandler:
Dim Cat As New ADOX.Catalog, StrConn$, StrPath$
StrPath = NewDBPath & "\" & NewDBName & ".mdb"
StrConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & StrPath & ";"
Set Cat = New ADOX.Catalog
Cat.Create StrConn
Exit Sub
ErrorHandler:
MsgBox "Error: " & Err.Description, vbCritical + vbOKOnly, "Error " & Err.Number & " in CreateDB!"
End Sub
No comments have been posted about Function to create Database using ADO(ActiveX Data Objects). Good news for ADO Programmers. You onl. Why not be the first to post a comment about Function to create Database using ADO(ActiveX Data Objects). Good news for ADO Programmers. You onl.