Solved

SQLDMO error in Test Case 31 for Windows Vista

Posted on 2007-04-05
2
335 Views
Last Modified: 2008-07-03
Hi Experts,

I´m trying to certificate my application to Windows Vista.
I´m using SQLDMO in a Visual Basic 6 application, but I´m having trouble in Test Case 31.

In the Test Code below I receive the message:
-2147483645-Automation error One or more arguments are invalid

Private Sub Command1_Click()
    Dim oNameList As Object
    Dim oApplication As Object
   
    Dim n As Integer
   
    On Error GoTo Erro
   
    Screen.MousePointer = vbHourglass
    Set oApplication = CreateObject("SQLDMO.Application")
    Set oNameList = oApplication.ListAvailableSQLServers
    Set oApplication = Nothing
    Combo1.Clear
    For n = 1 To oNameList.Count
        Combo1.AddItem oNameList(n)
    Next n
    Combo1.ListIndex = 0
    Set oNameList = Nothing
    Screen.MousePointer = vbDefault
    Exit Sub
Erro:
    Screen.MousePointer = vbDefault
    MsgBox Err.Number & "-" & Err.Description
    Set oApplication = Nothing
    Set oNameList = Nothing
End Sub

Private Sub Form_Load()
    Combo1.Clear
End Sub


AppVerifier log:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<avrf:logfile xmlns:avrf="Application Verifier">
      <avrf:logSession TimeStarted="2007-04-05 : 11:33:05" PID="3996" Version="2">
            <avrf:logEntry Time="2007-04-05 : 11:33:09" LayerName="Locks" StopCode="0x211" Severity="Error">
                  <avrf:message>Critical section is already initialized.</avrf:message>
                  <avrf:parameter1>1c454d60 - Critical section address.</avrf:parameter1>
                  <avrf:parameter2>59bcfe0 - Critical section debug info address.</avrf:parameter2>
                  <avrf:parameter3>4386cc - First initialization stack trace. Use dps to dump it if non-NULL</avrf:parameter3>
                  <avrf:parameter4>0 - Not used.</avrf:parameter4>
                  <avrf:stackTrace>
                        <avrf:trace>vfbasics!VfBasicsStopMessage+8e</avrf:trace>
                        <avrf:trace>vfbasics!AVrfpInitializeCriticalSectionCommon+116</avrf:trace>
                        <avrf:trace>vfbasics!AVrfpRtlInitializeCriticalSection+12</avrf:trace>
                        <avrf:trace>SQLDMO!DllRegisterServer+1e42b8</avrf:trace>
                        <avrf:trace>SQLDMO!+1c174bb6</avrf:trace>
                        <avrf:trace>SQLDMO!+1c174cc7</avrf:trace>
                        <avrf:trace>SQLDMO!DllRegisterServer+1e62c3</avrf:trace>
                        <avrf:trace>verifier!VerifierStopMessage+ea9</avrf:trace>
                        <avrf:trace>vrfcore!VfCoreStandardDllEntryPointRoutine+127</avrf:trace>
                        <avrf:trace>vfbasics!AVrfpStandardDllEntryPointRoutine+10e</avrf:trace>
                        <avrf:trace>ntdll!RtlReleaseSRWLockExclusive+3d</avrf:trace>
                        <avrf:trace>ntdll!RtlAcquirePebLock+429</avrf:trace>
                        <avrf:trace>ntdll!RtlAcquirePebLock+6f3</avrf:trace>
                        <avrf:trace>ntdll!LdrLoadDll+116</avrf:trace>
                        <avrf:trace>vfbasics!AVrfpLdrLoadDll+5c</avrf:trace>
                        <avrf:trace>kernel32!LoadLibraryExW+f9</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+32c</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+216</avrf:trace>
                        <avrf:trace>ole32!CoRegisterChannelHook+3821</avrf:trace>
                        <avrf:trace>ole32!CoRegisterChannelHook+3736</avrf:trace>
                        <avrf:trace>ole32!CoRegisterChannelHook+35fc</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+9ae</avrf:trace>
                        <avrf:trace>ole32!CoRegisterInitializeSpy+1dc9</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+b21</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+a96</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+60d</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+5be</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+b84</avrf:trace>
                        <avrf:trace>ole32!CoRegisterInitializeSpy+1dc9</avrf:trace>
                        <avrf:trace>ole32!CoRegisterInitializeSpy+1e8f</avrf:trace>
                        <avrf:trace>ole32!CoRegisterInitializeSpy+1dc9</avrf:trace>
                        <avrf:trace>ole32!CoRegisterInitializeSpy+1cf1</avrf:trace>
                        <avrf:trace>ole32!CoTaskMemAlloc+65e</avrf:trace>
                        <avrf:trace>ole32!CoCreateInstanceEx+38</avrf:trace>
                        <avrf:trace>ole32!CoCreateInstance+34</avrf:trace>
                        <avrf:trace>MSVBVM60!rtcCreateObject2+432</avrf:trace>
                        <avrf:trace>TC31!+401fb6</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+236db</avrf:trace>
                        <avrf:trace>TC31!+4019b4</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+239dc</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+23e43</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+2400f</avrf:trace>
                        <avrf:trace>MSVBVM60!EbLibraryUnload+dce1</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+2e7f8</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+31174</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+2fbdb</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+2f61c</avrf:trace>
                        <avrf:trace>MSVBVM60!BASIC_DISPINTERFACE_GetTICount+1cd8b</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+2e7f8</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+31174</avrf:trace>
                        <avrf:trace>USER32!GetMessageW+6e</avrf:trace>
                        <avrf:trace>USER32!GetMessageW+146</avrf:trace>
                        <avrf:trace>USER32!GetDesktopWindow+10a</avrf:trace>
                        <avrf:trace>USER32!SendMessageW+49</avrf:trace>
                        <avrf:trace>USER32!DrawFrame+6e2</avrf:trace>
                        <avrf:trace>USER32!DrawFrame+7f7</avrf:trace>
                        <avrf:trace>USER32!DrawFrame+816</avrf:trace>
                        <avrf:trace>USER32!EditWndProc+3fe</avrf:trace>
                        <avrf:trace>USER32!GetMessageW+6e</avrf:trace>
                        <avrf:trace>USER32!GetMessageW+146</avrf:trace>
                        <avrf:trace>USER32!CallWindowProcW+75</avrf:trace>
                        <avrf:trace>USER32!CallWindowProcA+1b</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+2ea31</avrf:trace>
                        <avrf:trace>MSVBVM60!EbLibraryUnload+dfb7</avrf:trace>
                  </avrf:stackTrace>
            </avrf:logEntry>
            <avrf:logEntry Time="2007-04-05 : 11:33:09" LayerName="Locks" StopCode="0x201" Severity="Error">
                  <avrf:message>Unloading DLL containing an active critical section.</avrf:message>
                  <avrf:parameter1>1c454d60 - Critical section address.</avrf:parameter1>
                  <avrf:parameter2>4386cc - Critical section initialization stack trace.</avrf:parameter2>
                  <avrf:parameter3>4624fe8 - DLL name address.</avrf:parameter3>
                  <avrf:parameter4>1c0b0000 - DLL base address.</avrf:parameter4>
                  <avrf:stackTrace>
                        <avrf:trace>vfbasics!VfBasicsStopMessage+8e</avrf:trace>
                        <avrf:trace>vfbasics!AVrfpFreeMemLockChecks+17c</avrf:trace>
                        <avrf:trace>vfbasics!AVrfpFreeMemNotify+39</avrf:trace>
                        <avrf:trace>vfbasics!AVrfpDllUnloadCallback+2c</avrf:trace>
                        <avrf:trace>ntdll!RtlApplicationVerifierStop+663</avrf:trace>
                        <avrf:trace>ntdll!RtlDeleteAce+296d</avrf:trace>
                        <avrf:trace>ntdll!LdrUnloadDll+46</avrf:trace>
                        <avrf:trace>ntdll!TpWaitForWork+180</avrf:trace>
                        <avrf:trace>ntdll!LdrLoadDll+116</avrf:trace>
                        <avrf:trace>vfbasics!AVrfpLdrLoadDll+5c</avrf:trace>
                        <avrf:trace>kernel32!LoadLibraryExW+f9</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+32c</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+216</avrf:trace>
                        <avrf:trace>ole32!CoRegisterChannelHook+3821</avrf:trace>
                        <avrf:trace>ole32!CoRegisterChannelHook+3736</avrf:trace>
                        <avrf:trace>ole32!CoRegisterChannelHook+35fc</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+9ae</avrf:trace>
                        <avrf:trace>ole32!CoRegisterInitializeSpy+1dc9</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+b21</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+a96</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+60d</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+5be</avrf:trace>
                        <avrf:trace>ole32!CoGetTreatAsClass+b84</avrf:trace>
                        <avrf:trace>ole32!CoRegisterInitializeSpy+1dc9</avrf:trace>
                        <avrf:trace>ole32!CoRegisterInitializeSpy+1e8f</avrf:trace>
                        <avrf:trace>ole32!CoRegisterInitializeSpy+1dc9</avrf:trace>
                        <avrf:trace>ole32!CoRegisterInitializeSpy+1cf1</avrf:trace>
                        <avrf:trace>ole32!CoTaskMemAlloc+65e</avrf:trace>
                        <avrf:trace>ole32!CoCreateInstanceEx+38</avrf:trace>
                        <avrf:trace>ole32!CoCreateInstance+34</avrf:trace>
                        <avrf:trace>MSVBVM60!rtcCreateObject2+432</avrf:trace>
                        <avrf:trace>TC31!+401fb6</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+236db</avrf:trace>
                        <avrf:trace>TC31!+4019b4</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+239dc</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+23e43</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+2400f</avrf:trace>
                        <avrf:trace>MSVBVM60!EbLibraryUnload+dce1</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+2e7f8</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+31174</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+2fbdb</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+2f61c</avrf:trace>
                        <avrf:trace>MSVBVM60!BASIC_DISPINTERFACE_GetTICount+1cd8b</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+2e7f8</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+31174</avrf:trace>
                        <avrf:trace>USER32!GetMessageW+6e</avrf:trace>
                        <avrf:trace>USER32!GetMessageW+146</avrf:trace>
                        <avrf:trace>USER32!GetDesktopWindow+10a</avrf:trace>
                        <avrf:trace>USER32!SendMessageW+49</avrf:trace>
                        <avrf:trace>USER32!DrawFrame+6e2</avrf:trace>
                        <avrf:trace>USER32!DrawFrame+7f7</avrf:trace>
                        <avrf:trace>USER32!DrawFrame+816</avrf:trace>
                        <avrf:trace>USER32!EditWndProc+3fe</avrf:trace>
                        <avrf:trace>USER32!GetMessageW+6e</avrf:trace>
                        <avrf:trace>USER32!GetMessageW+146</avrf:trace>
                        <avrf:trace>USER32!CallWindowProcW+75</avrf:trace>
                        <avrf:trace>USER32!CallWindowProcA+1b</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+2ea31</avrf:trace>
                        <avrf:trace>MSVBVM60!EbLibraryUnload+dfb7</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+2e7f8</avrf:trace>
                        <avrf:trace>MSVBVM60!IID_IVbaHost+31174</avrf:trace>
                        <avrf:trace>USER32!GetMessageW+6e</avrf:trace>
                        <avrf:trace>USER32!GetMessageW+146</avrf:trace>
                        <avrf:trace>USER32!IsWindow+14d</avrf:trace>
                  </avrf:stackTrace>
            </avrf:logEntry>
      </avrf:logSession>
</avrf:logfile>
0
Comment
Question by:JairoMarques
2 Comments
 
LVL 2

Expert Comment

by:IanWelch
ID: 18862132
The code worked fine on my Vista machine.

Having said that, there's the possibility that no servers are found in which case the line
Combo1.ListIndex = 0
would result in error.

Can you try the following code and see if you still get error. If so, on what line does the error occur?

Private Sub Command1_Click()
        Dim oNameList As SQLDMO.NameList
        Dim n         As Long

        On Error GoTo Erro

1000    Screen.MousePointer = vbHourglass
1010    Set oNameList = SQLDMO.Application.ListAvailableSQLServers
1020    Combo1.Clear

1030    If oNameList.Count > 0 Then
1040        For n = 1 To oNameList.Count
1050            Combo1.AddItem oNameList(n)
1060        Next n
        End If

1070    Set oNameList = Nothing

1080    If Combo1.ListCount > 0 Then
1090        Combo1.ListIndex = 0
        End If

1100    Screen.MousePointer = vbDefault

        Exit Sub

Erro:
1110    Screen.MousePointer = vbDefault
1120    MsgBox Err.Number & "-" & Err.Description & vbCrLf & "at line " & Erl
1130    Set oNameList = Nothing
End Sub

Private Sub Form_Load()
    Combo1.Clear
End Sub
0
 

Accepted Solution

by:
JairoMarques earned 0 total points
ID: 18869612
IanWelch,

the code works fine if I don´t use AppVerifier and Windbg.

I´m talking about TC 31. You need to use AppVerifieer and Windbg.

Using your code the error occur on line 1010. Same message.

In my test machine I installed SQL Server 2005 Express edition.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
execute a MS SQL script as a schedule SQL job 72 123
SQL Express connecting form remote error 26 7 39
Can’t delete a file 14 138
Query to Add Late Tolerance 10 60
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now