What’s Really Causing ActiveX Error 429 ?

In accomplishing one of my software development project, I happen to create some small program to test whether some of my idea can achieve certain intended goal.

And the type of small program I’ve created is in the form of Excel Macro application that try to access the Excel file via ODBC framework.

In no time, the test program is finished, and I’m ready to run it, but unfortunately, I encountered this error :

After performing some debugging, the error is caused by this statement in my Excel Macro routine :

Searching through MSDN for the string “Run-time error ‘429’” or “Run-time error 429” yields only some vague hint as to the causes of this kind of error :

Run-time error ‘429’: ActiveX component can’t create object

This error occurs when the Component Object Model (COM) cannot create the requested Automation object, and the Automation object is therefore unavailable to Visual Basic. This error does not occur on all computers.

So, in my case, what kind of object that the COM try to create ? Surely it is ADODB object. So, I have to find the missing component and register it using regsvr32.exe or just install it. But which component file/DLL to be checked whether it is already registered/installed or not ?

One popular way to ‘find’ this missing component is to provide some ‘intuitive’ solution using the guesses, such as, OK, maybe it is caused by Data Access Component is not installed properly in the machine. If this do not eliminate the problem, then one can conjure up another guess, maybe this, maybe that, depends on the depth experience of related person.

Consequences of this kind of solution tends to wasting some time, especially when the guessed solution do not work. It also have some psychological effects for the unfortunate person, especially when the error has to be resolved in critical situations.

The other way is to fire up the Google search engine, and performing the searching of “error 429” in relation to the ADODB object. Hopefully 🙂 you then arrive at my article.

Here, I will pinpoint the exact location of the above error, by using WinDBG (Window’s Debugger). But now, the problem is, how I managed to break into the error routine ?

Thanks to the accessibility framework provided by Microsoft, I can now create some small program to ‘probe’ the kind of user interface used by Excel application to show the error message.

Using this small program, I can now identify type of UI as a type of dialog box. Using WinDBG, by breaking into the DialogBoxParam windows function, now, I can begin to track down the problem :

WARNING: Stack unwind information not available. Following frames may be wrong.
0013e040 65114149 65300000 00000fb5 005c0494 USER32!DialogBoxParamA
0013e0a8 6511567d 65114131 0013e0c0 0013e0c8 VBE6!DllVbeInit+0x81e05
0013e0d4 651156bd 65300000 00000fb5 650fbf04 VBE6!DllVbeInit+0x83339
0013e184 65166972 0013e19c 00000001 65231000 VBE6!DllVbeInit+0x83379
0013e1c8 650b30e9 65231078 65231000 0016008c VBE6!GetLongPathNameA+0xefaa
0013e200 65056b7f 00000000 65056bb8 00000001 VBE6!DllVbeInit+0x20da5
0013e31c 77135cd9 0017e3e8 00000000 00000000 VBE6!rtcBeep+0x875b
0013e334 6504e62c 00000000 001b4892 00000004 OLEAUT32!DispCallFunc+0x16a
0013ec90 65045f1f 00000000 001b4854 60000000 VBE6!rtcBeep+0x208
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE –
0013ecc4 301197a6 001c95e0 60000000 300777e4 VBE6+0x45f1f
0013ed80 301196da 015f10f8 0013ee34 00000000 EXCEL!Ordinal41+0x1197a6
0013ee10 30203ce4 01ce235c 015f10f8 00000001 EXCEL!Ordinal41+0x1196da
0013ee5c 30203e69 00000000 0013f148 0013ee34 EXCEL!Ordinal41+0x203ce4
0013f158 30205161 015f05c0 015f10f8 00000000 EXCEL!Ordinal41+0x203e69
00000000 00000000 00000000 00000000 00000000 EXCEL!Ordinal41+0x205161

Surprisingly, since there are no public debug symbol for VBE6.DLL. The missing public symbol for this DLL rather unusual for microsoft product, which would create grave consequences because of the rising popularity of open office application.

Even with the availability of public symbol, the problem is already difficult to solve. So, when more and more problem crops up without this crucial stuff, it will put Microsoft Office product to extreme disadvantages.

OK, let’s put the annoyances aside and focus to the above stack information.

By examining the passed parameter to the documented DialogBoxParam function, we can determine the Dialog Procedure that handles incoming windows messages to be at 650FBF04.

Next, by performing conditional break point method for WM_INITDIALOG (0x0110) message that is already explained in previous post, I can pinpoint the location of error message string variable. This error string is written using the SetDlgItemText windows function.

By using the error string as the starting point, I can perform the backtracking of the error codes responsible for the error string which is located at :

:651CFBE8 push dword[ebp+08] ;;Error Number 0x1AD = 429
:651CFBEB call 6507AB0C ;;Translating Error Number to apropriate string

The first parameter passed at adress 651CFBE8, which is the error code again can be back-tracked to the existing previous stacks to be some transformation from the error code at :

65168882 mov eax,dword ptr [esi+1Ch] ;;ds:0023:65231094=800a01ad

The value 0x1AD is obtained by zeroing the high order word of 0x800A01AD

Next, this error code is accessed using the global variable in VBE6.DLL :

65046188 mov eax,offset VBE6!rtcArray+0x5380 (65231078) ;;Offset 0x1C contains the error code 0x800A01AD

By performing the break-point on memory write at location 0x65231078 + 0x1C = 0x65231094 :

ba w1 65231094

It is found that this memory location is written somewhere at this address location :

650b3411 8bfb mov edi,ebx
650b3413 f3a5 rep movs dword ptr es:[edi],dword ptr [esi]

At this point, I have to resort to some “intuitive” analysis of this address location. This is because there are no more stack back-trace at this memory location, which suggested that I have to locate the start of this function that eventually leads to this memory address.

After performing some analysis, I arrived at the curious stack back-trace as follows :

ChildEBP RetAddr Args to Child
WARNING: Stack unwind information not available. Following frames may be wrong.
0013e1c4 6522bef9 80020009 80020009 65231000 VBE6+0x4630c
0013e1fc 6504bb55 0017797c 00000000 0013e210 VBE6!rtcArray+0x201
0013e31c 77135cd9 001695d0 00000000 00000000 VBE6+0x4bb55

The first parameter 0x80020009 looks like an error code, which is confirmed in WinError.h as :

#define DISP_E_EXCEPTION _HRESULT_TYPEDEF_(0x80020009L)

This error code is the result of transformation from the original COM error code after the call to CoCreateInstanceEx :

:651EC8AB push ecx
:651EC8AC push 004
:651EC8AE push esi
:651EC8AF push 005
:651EC8B1 push esi
:651EC8B2 push edx ;;rcls id (referenced class id)

:651EC8E0 call eax ;;ole32!CoCreateInstanceEx

Returned error code is 0x80040154 which is :

#define REGDB_E_CLASSNOTREG _HRESULT_TYPEDEF_(0x80040154L)

So, what is the missing class id here ?

0:000> d ds:0017ec30
0023:0017ec30 14 05 00 00 00 00 10 00-80 00 00 aa 00 6d 2e a4

In order to be searchable in to the registry, the above memory value should be transformed to apropriate class id format :

00000514-0000-0010-8000-00AA006D2EA4

In registry editor, the description of this class id is ADODB.ConnectionClass, using the ADODB.Connection.2.8 version, but there are no associated DLL for this class id.

Back to square one, I now have the class id, but what DLL associated with this class ID ? I can find it in the other machine for this ID, or just look at the References in Excel macro’s tool setting.

The reference in this case is C:\Program Files\Common Files\System\ado\msado15.dll. By trying to register this DLL using regsvr32.exe, the case is solved.

Until here, you may asked, why don’t just register the msado15.dll instead of going through this painstaking road ? Well, at first, I am also at lost to find what DLL that has the above GUID, and luckily, when I tried to register the DLL provided by Excel’s setting, the problem are gone, so I can conclude that the above GUID belongs to msad015.dll.

So, using this method, even if we do not know the DLL that linked to the GUID, at least we have some piece of information to look for, i.e. the GUID, instead of using try and error, a.k.a. ‘intuitive’ method, although it still leave some portion of intuitive guess.

I am rather dissatisfied to end this article still by resorting to the luck or intuitive factor. There should be some method to reveal the correlation between the DLL and its GUID. In other words, there should be some way to prove that msado15.dll is indeed has the above GUID for ADODB.ConnectionClass.

When this method is found, the next step is to provide the list or library of all correlation between GUID and its related DLL, place it in the website so that everyone can refer to it.

So, is it possible to devise this method ? You will find it in my next article, if any 🙂

Advertisements

3 Responses to “What’s Really Causing ActiveX Error 429 ?”

  1. Kannan Says:

    I also have similar 429 error when I try to create instance of office web component spreadsheet method. ie., set oSS = new OWC11.Spreadsheet

    It works perfectly in my machine, But fails in the Production sever which I dont have access to. Is there any tool that can list the dependencies so that I can compare the my dev and prod environment.

  2. ekasiswanto Says:

    For the troubled statement (set oSS = new OWC11.Spreadsheet), at your machine, can you retrieve the GUID that is involved ? This is a very important piece information to start with.

    Or, alternatively, I think you can try the regmon utility to monitor the registry access in your production environment. But I haven’t tried it by myself.

    It would be nice if you can debug your prod environment 😉

  3. relationship counseling Says:

    Howdy! I realize this is sort of off-topic however I had to ask.
    Does operating a well-established website like yours require
    a massive amount work? I am brand new to operating a blog however I do write in my diary on a daily basis.

    I’d like to start a blog so I can easily share my experience and
    views online. Please let me know if you have any kind of recommendations or tips for brand new aspiring blog owners.

    Appreciate it!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: