Solved

WindowsXP service pack2 : Error429 ActiveX component can't create object

Posted on 2004-10-05
12
1,761 Views
Last Modified: 2008-01-09
Only on windowsXp service pack 2, I am unable to run my application.
I created a small sample hereby included which doens't work on Xp 2

The error from above arises on : "Set dbConn = New ADODB.Connection"

Any idea please?

Option Explicit
Dim dbConnection As ADODB.Connection
Dim dbConnection_Selections As ADODB.Connection
Dim strConnection As String
Dim rsTable As ADODB.Recordset
Dim rsTable_Selections As ADODB.Recordset

Private Sub Form_Load()
Screen.MousePointer = vbHourglass
DoEvents
SendToErrorFile "DBS is being loaded", True
DB_OpenLocalDBConnection dbConnection, "C:\wvb.mdb"
DB_OpenLocalDBTable dbConnection, rsTable, "tbl_Data"
SendToErrorFile "DBS loaded", False
Screen.MousePointer = 0
End Sub

Sub SendToErrorFile(msg As String, bKill As Boolean)
Dim strfile As String
Dim nFile As Integer
nFile = FreeFile
strfile = "c:\0Testfile.txt"
If bKill = True Then FileExist strfile, True
Open strfile For Append As nFile
Print #nFile, Format$(Now, "d mmm yyyy hh:mm:ss") + " - " + msg
Close #nFile
End Sub

Sub DB_OpenLocalDBConnection(dbConn As ADODB.Connection, strDBFile As String)
Dim strConnection As String
'strConnection = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" + strDBFile
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" + strDBFile
SendToErrorFile strConnection, False
Set dbConn = New ADODB.Connection
SendToErrorFile "db Connection Set", False
dbConn.Open strConnection
SendToErrorFile "db Connection Opened", False
End Sub

Sub DB_OpenLocalDBTable(dbConn As ADODB.Connection, rst As ADODB.Recordset, strTableToOpen As String)
   Set rst = New ADODB.Recordset
    SendToErrorFile "Table Set", False
   rst.CursorType = adOpenKeyset  'adOpenStatic
   SendToErrorFile "CursorType Set", False
   rst.LockType = adLockOptimistic  'adLockBatchOptimistic
   SendToErrorFile "LockType Set", False
   rst.Open strTableToOpen, dbConn, , , adCmdTable
   SendToErrorFile "Table Open", False
End Sub

Function FileExist(strFileName As String, Optional KillIt As Boolean, Optional CopyKillIt As Boolean) As Boolean
Dim nFile As Integer
On Error Resume Next
nFile = FreeFile
Open strFileName For Input As nFile
If Err.Number <> 0 Then
    FileExist = False
Else
    FileExist = True
End If
Close nFile
If KillIt = True Then
    Kill strFileName
End If
End Function

0
Comment
Question by:pgins
  • 7
  • 5
12 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 12226789
Have you added the ms ADO reference?
0
 

Author Comment

by:pgins
ID: 12226944
In the ref I have the Microsoft ActiveX Data Objects 2.5 Library  msado25.tlb

Additional info : I used the microsoft application wizard to create a setup for the demo hereby included
and indeed this file gives a can't registration error on xp version2


0
 

Author Comment

by:pgins
ID: 12228478
Additional info:
after replacing the msado25.tlb by the msado15.dll the setup needs the mdac_type.exe
when downloading mdac_type.exe 2.8 from microsoft and trying to install mdac we have MDAC 2.8 RTM incompatibilty error.

Indeed the register already contains in
LOCAL_MACHINE\SOFTWARE\Microsoft\DataAccess\fullinstalvers = 2.81.1117

Which file is missing or what should be changed in the source to make it compatible with xp version2 ?



0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:pgins
ID: 12232828
After installing mdac 2.8 on proper unit, the reference file msado15.dll is in VB automatically replaced by msado27.tlb.
But after compilation and reinstalling a new created setup file : still the same error on WindowsXP Sp2
I also verified if those files are on the xp sp2 unit; they are.
Somebody has any idea please?


0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 12236414
1. Have you tried to add 2.8 as ado reference on your vb project?

2. You can also use late binding

ie

Dim dbConnection As object


set dbConnection =createobject("ADODB.Connection")

etc

0
 

Author Comment

by:pgins
ID: 12236714
1. Yes I did so
2. Replaced code with yr proposal

Private Sub Form_Load()
Dim dbConnection As Object
On Error GoTo errorhandler
  SendToErrorFile "DBS being loaded", True
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:\wvb.mdb"
  SendToErrorFile strConnection, False
Set dbConnection = CreateObject("ADODB.connection")
  SendToErrorFile "Setted", False
dbConnection.Open strConnection
  SendToErrorFile "db Connection Opened", False
Exit Sub
errorhandler:
MsgBox Str$(Err.Number) + ":" + Err.Description + Str$(Err.HelpContext) + Err.HelpFile
End
End Sub

Result from testfile should be :
6 okt 2004 14:09:44 - DBS being loaded
6 okt 2004 14:09:44 - Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:\wvb.mdb
6 okt 2004 14:09:44 - Setted
6 okt 2004 14:09:45 - db Connection Opened
6 okt 2004 14:09:45 - DBS loaded

But error 429 (1000429) on XP SP2 before object is set online : Set dbConnection = CreateObject("ADODB.connection")
Meanwhile it seems to work on some XP SP2 units and on some not.
When latest MDAC or JET is loaded from microsoft > no way to start setup since files on unit are more recent then the downloaded files




0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 12236809
You meant it still failed on the line

Set dbConnection = CreateObject("ADODB.connection")


?
0
 

Author Comment

by:pgins
ID: 12237365
Yes it do (sorry for my long answer I only want to give maximum info)
0
 
LVL 26

Accepted Solution

by:
EDDYKT earned 500 total points
ID: 12237431
Only one suggestion, turn off the firewall and try again

from control panel->windows firewall->off

and try

or add your task on the advanced tab
0
 

Author Comment

by:pgins
ID: 12237782
Tried both, still the same
0
 

Author Comment

by:pgins
ID: 12239615
I replace ref by Microsoft DAO 3.6 Object library (dao360.dll)
Removed all adodb.connections
Replaced dbconnection.execute by dbconnection.openrecordset and a few other items

Dim dbConn as database
Dim rst as recordset

Set dbConn = OpenDatabase(strDBFile)
Set rst = dbConn.OpenRecordset(strTableToOpen)

works fine with XP sp2

So if somebody search for 429 error on xp sp2 : remove all yr adodb connections, I gave it up after 4 days.
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 12240188
I don't thine there is problem

Now you use DAO instead of ADO
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question