Re: How to get an ADO control in my Excel 2002?



I don't think there is an ADO control but you will need a reference to the
Microsoft ActiveX Data Objects Library and this code will set the reference
to that library:

Sub AddADO()

   Dim r

For Each r In ThisWorkbook.VBProject.References
If r.GUID = "{00000205-0000-0010-8000-00AA006D2EA4}" And r.Major = 2 Then
Exit Sub
End If
Next


   On Error GoTo NOTFOUND

'although usually the ADO version will be higher, doing Minor:=0 will install
'the higher version if available. On the other hand when you specify Minor:=5
'and only a lower version is available, this can't be installed
'----------------------------------------------------------------------------
ThisWorkbook.VBProject.References.AddFromGuid _
GUID:="{00000205-0000-0010-8000-00AA006D2EA4}", _
Major:=2, Minor:=0
Exit Sub


NOTFOUND:
   On Error GoTo 0

End Sub


Once you have this reference you can set your connection and work with the database.
Plenty of examples on the net how to do this.



RBS


"NiceGuy" <NiceGuy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:D66FF1C1-93E1-4662-8AF5-54EB19D57D07@xxxxxxxxxxxxxxxx
I'm developing a small program using Excel 2002 and VBA with a connection to
Access. However there is no ADO control in my excel. Where do I get one and
how to register it?

.



Relevant Pages

  • Re: 16 Bit Windows Subsystem Error S32EVNT1.DLL
    ... Bit Windows Subsystem error, as the Symantec KB provides the same solution ... the reference to Symantec appears in the error ... "16 Bit MS-DOS Subsystem" Error Message When You Install a Program ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: VBA References - when is Office Object Library Reference set? Best practice re. Early/Late bind
    ... Microsoft MVP - Excel ... My code is set up with a reference to "MS Office 11.0 Object Library", and works fine. ... > If I set up my test system with Win2000/OfficeXP, and Office XP is set up to install everything on first use, then install my stuff, I find that the VBA will not compile, because the projects are still referencing the Office 11.0 object library and no reference has been set up to the Office 10.0 library. ... > Also, on Office XP installations that use the default installation options, the Office 10.0 reference is already there before I install my stuff and the correct reference is automagically used. ...
    (microsoft.public.excel.programming)
  • Re: VBA References - when is Office Object Library Reference set? Best practice re. Early/Late bind
    ... Don't forget that you can develop with early binding and then convert to ... When is the reference to the correct version of the MS Office ... so need the correct reference in order for the code ... to install everything on first use, then install my stuff (basically a set ...
    (microsoft.public.excel.programming)
  • Re: Relating two forms
    ... method unless the control has focus'. ... > You will notice that I have removed reference to Code property, ... >> Dim stDocName As String ... >> Exit Sub ...
    (microsoft.public.access.forms)
  • Re: Another Programm use the tapi
    ... are not availeble ... > Please provide a link for reference. ... TAPI Kernel Modus Dienstanbieter ... >> Install the drivers for the telephone. ...
    (microsoft.public.win32.programmer.tapi)