dcsimg
Results 1 to 5 of 5

Thread: VB6 Program Works on Windows 7 32 but not on Windows 7 64

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    1

    VB6 Program Works on Windows 7 32 but not on Windows 7 64

    This is my first post. I have an older VB6 application that works fine under Windows 7 32bit but not on the 64bit version. I am upgrading my clients to 64bit and need to get this resolved. A runtime error 91 occurs when the application is started and tries to access the SQL 2008r2 database via ODBC.

    The database access is done using a Connection in the Data Environment using the 'Microsoft OLE DB Provider for ODBC Drivers' . Here is the Provider Property:
    Provider=MSDASQL.1;Password="";Persist Security Info=True;User ID=sa;Data Source=EscrowLogin

    Here is the program code:

    Private Function LoginDBTestConnection() As Boolean

    On Error Resume Next

    LoginDBTestConnection = False
    If Not goApp.Denv.Connection2.State = adStateClosed Then
    goApp.Denv.Connection2.Close
    End If
    goApp.Denv.Connection2.Open
    If Err.Number <> 0 Then
    MsgBox "The system failed to connect to the Login database." & vbCrLf & _
    "Please check the 'Company' database." & " Error =" & Err.Number
    Exit Function
    End If

    LoginDBTestConnection = True

    End Function

    I have made sure that the 32bit version of ODBC is correct on the Windows 7 64 PC and I can open a connection using a vb script file, but not from the program.

    What can cause this and can anyone provide assistance resolving this issue?

    Thanks in advance.

    Steve

  2. #2
    Frenzied Member
    Join Date
    Dec 2008
    Posts
    1,135

    Re: VB6 Program Works on Windows 7 32 but not on Windows 7 64

    Perhaps the Data Environment ain't installing well in the 64bit PC ?
    99% of experienced users will tell you not to use the Data Environment, and that is my advice too.
    Rob
    PS The other 1% gives me a negative rating whenever I tell people this.
    Let's see if he does it again

  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    12,488

    Re: VB6 Program Works on Windows 7 32 but not on Windows 7 64

    Is the program being installed properly? on 64 bit systems some files need to be installed in the syswow64 folder where they would be in system32 on a 32 bit system.

    I don;t use the data environment and I do not use ODBC to connect to SQL server. I instead use ADO and the SQL server provider. I always create a proper installer and have never had an issue running under any current MS OS.

  4. #4
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    3,791

    Re: VB6 Program Works on Windows 7 32 but not on Windows 7 64

    Data Environments will work on 64 bit machines. I have several old VB6 programs that use lots of Data Environments running on Win7 and Win 10 machines. DataMiser has brought up an important point, has you created a proper installer and did it work without problems. I know I had to modify my installers for 64 bit machines. But it's been so long ago I don't remember exactly what I had to do. Google "how to install vb6 programs on 64 bit machines" there is lots of information.

    A lot of people are caught in this situation, the VB6 installation disk also came with a MSDN VB6 Library documentation disk. Many of the coding examples used Data Environments.

  5. #5
    New Member
    Join Date
    Jan 2018
    Posts
    2

    Re: VB6 Program Works on Windows 7 32 but not on Windows 7 64

    I have many applications running on Win7 64bit that access our SQL servers without issue.
    I have had random crashes when running on Win7/10 32Bit. Changing the compatibility mode to XP SP3 seems to stop those crashes.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width