VB6 on Windows 7 sending data to Oracle

Adam_930
Adam_930 used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

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

Author

Commented:
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

Author

Commented:
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.
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Top Expert 2012

Commented:
Where do you install your configuration data?

Author

Commented:
eemit,
I am not sure I understand the question
Top Expert 2012

Commented:
Where is the location of your ini file?

Author

Commented:
eemit,
The application itself does not have an ini file
Which ini are you refering to?
Top Expert 2011

Commented:
- 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.

Author

Commented:
Thanks OP_Zaharin,
Been out for the holidays, will give it a try.

Author

Commented:
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
Top Expert 2012

Commented:
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"
Top Expert 2011

Commented:
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

Author

Commented:
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.

Author

Commented:
OP_Zaharin,
I did not see any errors during installation
Top Expert 2012
Commented:
To manage a data source that connects to a 32-bit driver under 64-bit platform,
use c:\windows\sysWOW64\odbcad32.exe

This link has some good information :
ODBC drivers not visible in the ODBC Data Source Administrator (odbcad32.exe)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial