VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Function to create Database using ADO(ActiveX Data Objects). Good news for ADO Programmers. You onl

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.

Rate Function to create Database using ADO(ActiveX Data Objects). Good news for ADO Programmers. You onl



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


Download this snippet    Add to My Saved Code

Function to create Database using ADO(ActiveX Data Objects). Good news for ADO Programmers. You onl Comments

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.

Post your comment

Subject:
Message:
0/1000 characters