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
Oracle DatabaseVB ScriptWindows 7

Avatar of undefined
Last Comment
eemit

8/22/2022 - Mon
Veegertx

Perhaps, we done this recently
Changed reference to Microsoft DAO 3.6 Object Library but we were using access databases.
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
Adam_930

ASKER
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.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
eemit

Where do you install your configuration data?
Adam_930

ASKER
eemit,
I am not sure I understand the question
eemit

Where is the location of your ini file?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Adam_930

ASKER
eemit,
The application itself does not have an ini file
Which ini are you refering to?
OP_Zaharin

- 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.
Adam_930

ASKER
Thanks OP_Zaharin,
Been out for the holidays, will give it a try.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Adam_930

ASKER
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
eemit

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"
OP_Zaharin

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
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Adam_930

ASKER
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.
Adam_930

ASKER
OP_Zaharin,
I did not see any errors during installation
ASKER CERTIFIED SOLUTION
eemit

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question