Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Activex Component cannot ...

Status
Not open for further replies.

Kaushik1975

Programmer
Jul 8, 2001
23
0
0
IN
Hello
I have installed VB. Tool reference of the ADO 2.0, but when i create a object of that i get a erro

"Activex Component cannot create object"

What is the solution to this
 
Dim Conn as Adodb.Connection

Private Sub Form_Load()
set conn = new Adodb.Connection 'I get the error here
End Sub


 
Do you have the reference to ADO 2.0 selected? Open the project, and from your menu go to Projects, References and verify that Microsoft Active X Data Objects 2.x Library is checked.
 
Try this:

Set conn = CreateObject("ADODB.Connection")

Either should work, but this is another way of doing it if you wanna try it.

-Mike
 
Try to regsvr32 the ado library usually msado15.dll.
Maybe is not registered well.

(If this happens in a asp page is usually a security problem)

:)-:)
s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darkness...
 
I do not have msado15.dll on my machine, i have msado15.tlb which is ADODB 2.0. How do u register a tlb file
 
The .TLB is what keeps you from getting a copmpile error on
Dim Conn as Adodb.Connection.
The .TLB has all the names and vTable offsets that are needed to compile but not having the DLL registered, or not having it at all is what is giving you the "Can't create object". The TLB (Type Library ) is useful only at compile time.

What you have is the equivalent of having the "Word" .OLB lib without having Word on registered on your machine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top