Results 1 to 3 of 3

Thread: OpenConnection Fails on Command Line Works in IDE

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2017
    Posts
    14

    OpenConnection Fails on Command Line Works in IDE

    Greetings,

    I have a vb 6.0 "desktop" application that has multiple components. One of those components is a dll that gets called to perform various database functions. These functions include making the database connection, submitting SQL queries and returning results. It all works fine when it's run in the VB 6.0 IDE. However, when I try to run it on the command prompt, it errors out. The error occurs at this line:

    Set Current_Database = Current_Workspace.OpenConnection("DOCUGEN Database", dbDriverNoPrompt, False, Connect_String)

    where we set the database connection using the OpenConnection method of the Workspace. The Current_Database is a DAO connection object. This error is not captured by the program, the On Error statement seems to have no effect, the program just crashes. I am able to get this information from the Application Verifier logs:

    <avrf:logfile xmlns:avrf="Application Verifier">
    <avrf:logSession Version="2" PID="4432" TimeStarted="2017-05-19 : 08:14:07">
    <avrf:logEntry Severity="Error" StopCode="0xE100" LayerName="Networking" Time="2017-05-19 : 08:14:08">
    <avrf:message>Illegal networking API called from DllMain</avrf:message>
    <avrfarameter1>74a11d10 - Networking function being called from DllMain</avrfarameter1>
    <avrfarameter2>8348fda - Name of Dll making invalid call if not NULL</avrfarameter2>
    <avrfarameter3>0 - Not used</avrfarameter3>
    <avrfarameter4>0 - Not used</avrfarameter4>-<avrf:stackTrace>
    <avrf:trace>vfnet!+74a13607 ( @ 0)</avrf:trace>
    <avrf:trace>OraOCIICUS11!ztcsl+39dd ( @ 0)</avrf:trace>
    <avrf:trace>OraOCIICUS11!+c991041 ( @ 0)</avrf:trace>
    <avrf:trace>OraOCIICUS11!ociepacm+3cb ( @ 0)</avrf:trace>
    <avrf:trace>OraOCIICUS11!ociepacm+484 ( @ 0)</avrf:trace>
    <avrf:trace>vrfcore!VerifierTlsSetValue+431 ( @ 0)</avrf:trace>
    <avrf:trace>vfbasics!VerifierDisableFaultInjectionExclusionRange+c55 ( @ 0)</avrf:trace>
    <avrf:trace>ntdll!RtlQueryEnvironmentVariable+241 ( @ 0)</avrf:trace>
    <avrf:trace>ntdll!LdrResSearchResource+b4d ( @ 0)</avrf:trace>
    <avrf:trace>ntdll!LdrResSearchResource+a10 ( @ 0)</avrf:trace>
    <avrf:trace>ntdll!LdrLoadDll+7b ( @ 0)</avrf:trace>
    <avrf:trace>vfbasics!VerifierDisableFaultInjectionExclusionRange+1087 ( @ 0)</avrf:trace>
    <avrf:trace>KERNELBASE!LoadLibraryExW+1f1 ( @ 0)</avrf:trace>
    <avrf:trace>KERNELBASE!LoadLibraryExA+26 ( @ 0)</avrf:trace>
    <avrf:trace>KERNEL32!LoadLibraryA+31 ( @ 0)</avrf:trace>
    <avrf:trace>OCI!koptdumptds_check+617 ( @ 0)</avrf:trace>
    <avrf:trace>OCI!lpminit+8 ( @ 0)</avrf:trace>
    <avrf:trace>SQORA32!SQLTablesW+36a ( @ 0)</avrf:trace>
    <avrf:trace>SQORA32!SQLTablesW+766 ( @ 0)</avrf:trace>
    <avrf:trace>verifier!+728fc66d ( @ 0)</avrf:trace>
    <avrf:trace>vrfcore!VerifierTlsSetValue+431 ( @ 0)</avrf:trace>
    <avrf:trace>vfbasics!VerifierDisableFaultInjectionExclusionRange+c55 ( @ 0)</avrf:trace>
    <avrf:trace>ntdll!RtlQueryEnvironmentVariable+241 ( @ 0)</avrf:trace>
    <avrf:trace>ntdll!LdrResSearchResource+b4d ( @ 0)</avrf:trace>
    <avrf:trace>ntdll!LdrResSearchResource+a10 ( @ 0)</avrf:trace>
    <avrf:trace>ntdll!LdrLoadDll+7b ( @ 0)</avrf:trace>
    <avrf:trace>vfbasics!VerifierDisableFaultInjectionExclusionRange+1087 ( @ 0)</avrf:trace>
    <avrf:trace>KERNELBASE!LoadLibraryExW+1f1 ( @ 0)</avrf:trace>
    <avrf:trace>ODBC32!VFreeErrors+2ff5 ( @ 0)</avrf:trace>
    <avrf:trace>ODBC32!SQLDisconnect+593 ( @ 0)</avrf:trace>
    <avrf:trace>ODBC32!SQLDisconnect+6f4 ( @ 0)</avrf:trace>
    <avrf:trace>MSRDO20!DllGetClassObject+1933 ( @ 0)</avrf:trace>
    <avrf:trace>MSRDO20!DllGetClassObject+1492 ( @ 0)</avrf:trace>
    <avrf:trace>MSRDO20!DllGetClassObject+e7f ( @ 0)</avrf:trace>
    <avrf:trace>MSRDO20!DllGetClassObject+d29 ( @ 0)</avrf:trace>
    <avrf:trace>MSRDO20!DllGetClassObject+c72 ( @ 0)</avrf:trace>
    </avrf:stackTrace>
    </avrf:logEntry>
    </avrf:logSession>
    </avrf:logfile>

    Does anyone have any idea what is going on and how this can be resolved? Moving to different technologies is not an option because there is too much code involved.

    Many thanks.

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: OpenConnection Fails on Command Line Works in IDE

    From the trace it looks like you are using RDO.

    Not sure what you mean when you talk about running "it" from the command line. I assume you must be talking about the VB6 desktop application.
    If that be the case and it works when running in the IDE then I would guess that maybe there is a timer causing you an issue since they work differently in the IDE than when compiled. Perhaps you have some code in a timer that is being triggered to soon when the exe is running, perhaps before your connect_string has been set or something to that effect. Hard to say with only one line of code shown but that would be my first guess.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2017
    Posts
    14

    Re: OpenConnection Fails on Command Line Works in IDE

    Thanks for the reply. Yes, apparently DAO uses RDO. You are correct, "It" does refer to the application itself. That is good information about the timing; I will be thinking about that and how it might be an issue in this problem. I appreciate your advise.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width