P
Paul Reavis
I have an application that I have developed using Word
getting information from a db in Access 2003.
We have 3 versions of Access and Word running in our
organization so I needed to use late binding.
The code populates a drop-down box in Word and for the
2003 version has the Reference to Microsoft DAO 3.6
library and reads like this:
Set db = OpenDatabase(Name:=fGetDBLocation())
Set qdf = db.CreateQueryDef("")
qdf.SQL = strSQL
Set rs = qdf.OpenRecordset()
If rs.EOF Then
strComboName.Item(3).Clear
Else
Do Until rs.EOF
For i = 1 To rs.Fields.Count
strComboName.Item(3).AddItem Text:= _
rs!entry, Index:=i
strComboName.Item(3).ListIndex = 1
Next
rs.MoveNext
Loop
End If
I have at least 2 problems. I have tried CreateObject
construct but then I do not know how to bind the created
instance to the particular database. The other problem is
the GetObject insists on Opening the application and if I
add the construct obj.visible = false then the object
opens in a visible fashion THEN becomes not visible. Also
I am unsure about the Object Model for this process so if
you might point me to something that would help me find
out what I need to construct I would appreciate it.
Thanks so much for your time in reading this any any
insight you might offer.
Paul Reavis
(e-mail address removed)
getting information from a db in Access 2003.
We have 3 versions of Access and Word running in our
organization so I needed to use late binding.
The code populates a drop-down box in Word and for the
2003 version has the Reference to Microsoft DAO 3.6
library and reads like this:
Set db = OpenDatabase(Name:=fGetDBLocation())
Set qdf = db.CreateQueryDef("")
qdf.SQL = strSQL
Set rs = qdf.OpenRecordset()
If rs.EOF Then
strComboName.Item(3).Clear
Else
Do Until rs.EOF
For i = 1 To rs.Fields.Count
strComboName.Item(3).AddItem Text:= _
rs!entry, Index:=i
strComboName.Item(3).ListIndex = 1
Next
rs.MoveNext
Loop
End If
I have at least 2 problems. I have tried CreateObject
construct but then I do not know how to bind the created
instance to the particular database. The other problem is
the GetObject insists on Opening the application and if I
add the construct obj.visible = false then the object
opens in a visible fashion THEN becomes not visible. Also
I am unsure about the Object Model for this process so if
you might point me to something that would help me find
out what I need to construct I would appreciate it.
Thanks so much for your time in reading this any any
insight you might offer.
Paul Reavis
(e-mail address removed)