Problem with running VB6 app in Windows 7(64bit) that had run in Windows XP(32bit).

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Problem with running VB6 app in Windows 7(64bit) that had run in Windows XP(32bit).

I had a VB6 application that was running fine on Windows XP, 32Bit.
I have now migrated it to Windows 7, 64Bit. I have an odbcconf.dll that the
project is looking/referecing for it in the Windows\System32 subdirectory. Should
it not be looking instead in the Windows\sysWOW64 subdirectory. How do
I change the path it is looking for the .dll. How do I determine if it is looking
at the right path.

Re: Problem with running VB6 app in Windows 7(64bit) that had run in Windows XP(32bi

Re: Problem with running VB6 app in Windows 7(64bit) that had run in Windows XP(32bi

I was given little more information. I have not run the program myself. I was going off info over a month old. The part that is not working is when the program communicates with the database and then remembers that for future communications. It uses the odbc32.dll. The
segment of the code worked for Windows XP, 32Bit but when run on Windows 7, 64bit the program hangs up. Since I have not seen the error, I do not know specifics. Here is the code:
------------------------------------
Option Explicit

Re: Problem with running VB6 app in Windows 7(64bit) that had run in Windows XP(32bi

After being able to run the code the following error is indicated:
[Microsift][ODBC driver for Oracle][ORACLE]ORA-06413: Connection not open.

This error comes up after the function SQLConnect is performed. It seems everything
else up to that point runs fine. Things were run in this sequence, SQLAllocEnv, SQLAllocConnect,
and then SQLConnect. After the error occurs in SQLConnect, the SQLError is run to get the error
message listed above. SqlState was NA000. So if everything is fine upt to this point what do I
need to look at. see code below.
-------------------------------------------------------------------------------------

Code:

' ***********************************************************************
' THIS IS A MICROSOFT DOWNLOAD TO VERIFY THE LOGIN ONTO A ODBC DATABASE
' ***********************************************************************
Dim henv As Long 'Environment Handle
Dim hdbc As Long 'Connection Handle
Dim iResult As Integer
'Obtain Environment Handle
iResult = SQLAllocEnv(henv)
If iResult <> SQL_SUCCESS Then
IsValidODBCLogin = False
Exit Function
End If
'Obtain Connection Handle
iResult = SQLAllocConnect(henv, hdbc)
If iResult <> SQL_SUCCESS Then
IsValidODBCLogin = False
iResult = SQLFreeEnv(henv)
Exit Function
End If
'Test Connect Parameters
iResult = SQLConnect(hdbc, sDSN, Len(sDSN), sUID, Len(sUID), _
sPWD, Len(sPWD))
If iResult <> SQL_SUCCESS Then
If iResult = SQL_SUCCESS_WITH_INFO Then
'The Connection has been successful, but SQLState Information
'has been returned
'Obtain all the SQLState Information
' If frmOracle.Check1.Value Then ShowSQLErrorInfo hdbc, vbInformation
IsValidODBCLogin = True
Else
'Obtain all the Error Information
' If frmOracle.Check1.Value Then ShowSQLErrorInfo hdbc, vbExclamation
' ***********************************************************************
' THE FOLLOWING COMMAND HAS BEEN REM'D OUT TO PREVENT THE ERROR CODE FROM
' POPPING UP ON THE SCREEN AND REQUIRING AN OPERATOR ACKNOWLEDGEMENT
' ***********************************************************************
' ShowSQLErrorInfo hdbc, vbExclamation
IsValidODBCLogin = False
End If
Else
IsValidODBCLogin = True
End If
' ***********************************************************************
' THE FOLLOWING LINE WAS ADDED FROM A RECOMMENDATION FROM MICROSOFT
' CASE # "SRZ060711002202" E-MAIL SUPPORT Ying Liu
' FROM THE ORIGINAL DOWNLOAD FROM MICROSOFT'S KB, DID NOT HAVE THIS LINE
' IN IT. THIS ITEM IS DELCARED AT THE TOP OF THIS MODULE
' ***********************************************************************
iResult = SQLDisconnect(hdbc)
'Free Connection Handle and Environment Handle
iResult = SQLFreeConnect(hdbc)
iResult = SQLFreeEnv(henv)
End Function
Public Sub ShowSQLErrorInfo(hdbc As Long, iMSGIcon As Integer)
' ***********************************************************************
' THIS IS A MICROSOFT DOWNLOAD TO VERIFY THE LOGIN ONTO A ODBC DATABASE
' ***********************************************************************
Dim iResult As Integer
Dim hstmt As Long
Dim sBuffer1 As String * 16, sBuffer2 As String * 255
Dim lNative As Long, iOutlen As Integer
sBuffer1 = String$(16, 0)
sBuffer2 = String$(256, 0)
Do 'Cycle though all the Errors
iResult = SQLError(0, hdbc, hstmt, sBuffer1, lNative, sBuffer2, _
256, iOutlen)
If iResult = SQL_SUCCESS Then
If iOutlen = 0 Then
MsgBox "Error -- No error information available", _
iMSGIcon, "ODBC Logon"
Else
MsgBox Left$(sBuffer2, iOutlen), iMSGIcon, "ODBC Logon"
End If
End If
Loop Until iResult <> SQL_SUCCESS
End Sub
Public Sub ConnectToOracle()
'frmOracleLoad.Show
'frmOracleLoad.lblOracleLoadConnect.Visible = True