The VB Zone Discussion Board Re(8): MDAC Posted on 3/16/2004 at 03:25:39 PM by KevinWilson
Instead of using EARLY BINDING by referencing the "Microsoft ActiveX Data Objects" library, then creating an instance of the Connection class... try leaving the reference to the ADO library out and use LATE BINDING. Use the "CreateObject" function to create an instance of the Connection class on the fly:
Dim cnValidate As Object
Set cnValidate = CreateObject("ADODB.Connection", vbNullString)
With cnValidate
.Provider = strProvider
.ConnectionString = strDBLocation
.Open
End With
Make sure you use error checking to make sure that you actually got a valid reference to a Connection object when you called "Set cnValidate = CreateObject(..)".
Kevin
Replies:
You must register before you can post on this board. You can register here.
Post a reply:
Click Here to view the "old"messageboard
MAIN |
DOWNLOADS |
SAMPLE CODE |
STEP BY STEP |
DISCUSSION BOARD |
LINKS |
AUTHOR
E-MAIL

|