Link to home
Start Free TrialLog in
Avatar of Adam_930
Adam_930

asked on

VB6 on Windows 7 sending data to Oracle

We have an existing application that has been running for many years on many different PCs, all with XP SP3, that sends data to an Oracle database (part number & quantity) to help track inventory. We are now converting the PCs to Windows 7 and I am not able to send the data. Is there something I need to use instead of MDAC? If so, what do I convert to & how?
thanks
Avatar of Veegertx
Veegertx
Flag of United States of America image

Perhaps, we done this recently
Changed reference to Microsoft DAO 3.6 Object Library but we were using access databases.
Avatar of Adam_930
Adam_930

ASKER

Additional Info:
Here is the declaration:
        Private Declare Function SQLConnect Lib "odbc32.dll" ( _
           ByVal hdbc As Long, ByVal szDSN As String, _
           ByVal cbDSN As Integer, ByVal szUID As String, _
           ByVal cbUID As Integer, ByVal szAuthStr As String, _
           ByVal cbAuthStr As Integer) As Integer

--------------------------------------------------------------------------------------------------------------------------
        iResult = SQLConnect(hdbc, sDSN, Len(sDSN), sUID, Len(sUID), _
                  sPWD, Len(sPWD))

The above will work in VB6 on XP and will always get a (-1) VB6 on Windows 7
Thanks Veegertex, I already had Microsoft DAO 3.6 reference selected. I tried de-selecting the Micorsoft Data Access Componets Installed version, no help. I tried browsing to the \WoW64 subdiretory and selecting odbcconf.dll since the MDAC was pointing to the \system32 subdirectory. still no help.
Avatar of eemit
Where do you install your configuration data?
eemit,
I am not sure I understand the question
Where is the location of your ini file?
eemit,
The application itself does not have an ini file
Which ini are you refering to?
- i've recently write a vb6 code to connect to Oracle database on Windows 7 using the built-in Microsoft ODBC for Oracle driver. in the References option, I use Microsoft ActiveX Data Objects 2.8 Library. if you are using other type of libraries, try choose the latest version of that library on Windows 7.

- as for the ODBC system DSN, I create it from the Control Panel itself.
Thanks OP_Zaharin,
Been out for the holidays, will give it a try.
OP_Zaharin,
The same application on an XP machine works the way it is suppose to.
When I put it on a Windows7 64Bit machine the following line never is succesful

        iResult = SQLConnect(hdbc, sDSN, Len(sDSN), sUID, Len(sUID), _
                  sPWD, Len(sPWD))

The SQLConnect is defined in the following:

        Private Declare Function SQLConnect Lib "odbc32.dll" ( _
           ByVal hdbc As Long, ByVal szDSN As String, _
           ByVal cbDSN As Integer, ByVal szUID As String, _
           ByVal cbUID As Integer, ByVal szAuthStr As String, _
           ByVal cbAuthStr As Integer) As Integer

I am wondering if my "odbc32.dll" is pointing to the one in the Windows\system32 directory instead of pointing to the Windows\SysWOW64 directory. How to change where it points?

The other item I noticed that is different is the:
Microsoft ActiveX Data Objects 2.8 Library
XP machine points to msado15.dll
W7 machine points to msado28.tlb
Do you consider that a 64-bit Windows has:
- two different versions of the system directory:
      System32 - Windows System folder for 64-bit files
      SysWOW64 - Windows System folder for 32-bit files

- two versions of the regsvr32.exe file:
      The 64-bit version is %systemroot%\System32\regsvr32.exe
      The 32-bit version is %systemroot%\SysWoW64\regsvr32.exe

      Open up the cmd prompt using "Run as Administrator"
hi adam,
- during the initial installation of vb6 on that machine, do you encounter any problem or error? i've actually follows the following step  which after that I don't have any issues on running my old XP code in windows 7:
http://www.fortypoundhead.com/showcontent.asp?artid=20502
Eemit,
Yes is am aware of the two (2) different directories, I am guessing the my app is pionting toward the 64 bit directory file and I can't find where to make it point to the 32 bit directory file.
OP_Zaharin,
I did not see any errors during installation
ASKER CERTIFIED SOLUTION
Avatar of eemit
eemit
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial