This is a shot in the dark but -

I have some code where I need to use late binding to open a DAO database
object using a system DSN. The problem I am having is that on the machine
I need to run this code, late binding does not work. So for testing, I created
a small VB test app with two routines - one that uses early binding and one
that uses late binding. Both routines work fine on my machine, but only
the early binding routine works on the target machine.

I have to use late binding because ultimately, this code will be used in
a Lotus Notes routine and there is no way to use early binding in Notes.


Here are my test routines. The late binding routine is crashing on the CreateObject
line.


Private Sub cmdTestEarly_Click()
Dim dbE As DAO.DBEngine
Dim ws As DAO.Workspace
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strConnect As String

Set dbE = New DAO.DBEngine

'On the target machine this message says "Version: 3.51"
MsgBox "Version: " & DAO.DBEngine.Properties("Version")

Set ws = dbE.CreateWorkspace("", "admin", "", dbUseJet)

strConnect = "ODBC;;DSN=testdsn;"
Set db = ws.OpenDatabase("", False, True, strConnect)

Set rst = db.OpenRecordset( _
"select count(*) as numrecs from testtable", _
dbOpenSnapshot, dbReadOnly)

MsgBox "Records Found: " & Trim(Str(rst("numrecs")))

rst.Close
Set rst = Nothing
db.Close
Set db = Nothing
ws.Close
Set ws = Nothing
Set dbE = Nothing
End Sub


Private Sub cmdTestLate_Click()
Dim dbE As Object
Dim ws As Object
Dim db As Object
Dim rst As Object
Dim strConnect As String

Set dbE = CreateObject("DAO.DBEngine.35") '????Crashes here????

Set ws = dbE.CreateWorkspace("", "admin", "", dbUseJet)

strConnect = "ODBC;;DSN=testdsn;"

Set db = ws.OpenDatabase("", False, True, strConnect)

Set rst = db.OpenRecordset( _
"select count(*) as numrecs from testtable", _
dbOpenSnapshot, dbReadOnly)

MsgBox "Records Found: " & Trim(Str(rst("numrecs")))

rst.Close
Set rst = Nothing
db.Close
Set db = Nothing
ws.Close
Set ws = Nothing
Set dbE = Nothing

End Sub


I have searched MDSN and found articles on runtime licensing which said to
add registry keys and so on. Nothing has worked yet. Does anyone have any
idea what would cause the late binding not to work?

My machine is NT 4, VB6 SP3 and the target machine is Win95 with DCOM95 and
MDAC. Both machines have MDAC 2.1 installed.


Thanks,
Robert.