How to know whether it is using ADO ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am writing a data entry sheet in Excel to store data in cells to a
database file. This entry sheet would be given to people using different
computers to enter their data respectively. This entry form would probably
not work if it is not making reference to ADO objects. The problem is : how
could I know, programmatically, whether it is making reference to the ADO
objects and how could I set reference, also programmatically, to ADO objects.

Thanks in advance!
 
Not sure I understand your question.

If you use late binding, ADO simply needs to be present on oher users' Pc
and your code will work. If you use early binding, the reference to the same
object as on your machine must be possible: i.e. your users must have the
same version of ADO as you.

I'd use late binding and avoid all the early binding issues.
 
AA2e72E said:
If you use late binding, ADO simply needs to be present on oher users' Pc
and your code will work. If you use early binding, the reference to the same
object as on your machine must be possible

It may not be a simple as that but late binding would still be the way
to go e.g.

Sub test()
Dim oStream As Object

On Error Resume Next
Set oStream = CreateObject("ADODB.Stream")
On Error GoTo 0

If oStream Is Nothing Then
' User may only have ADO version 2.1
' so exit gracefully here.
End If

' Code continues ...

End Sub

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top