Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I have an old VB6 app that I need to get working on a Windows 7 x64 workstation (at least for a little while).
It's failing on me when I try to connect to my test database (Oracle 10gR2). I get an "ORA-06413: Connection not open error."
Now, I recognise that the "Microsoft ODBC for Oracle" driver is deprecated because it doesn't play nice with newer versions of Oracle. It seems to work fine with the same database on an XP box I have access to.
I also see that the driver seems to still exist on Windows 7 x64 (at least when I look at the 32 bit version of the ODBC data Source Administrator tool: c:\Windows\SysWOW64\odbcad32.exe in the Drivers tab.
On the XP box, it doesn't seem to matter what I see up for an ODBC connection, it seems to bypass any sort of predefined connection.
Attached is the relevant code. Is there any way to make this work in Win7x64?
Global g_sConnectionString As String
Global g_oConn As ADODB.Connection
Public Sub CreateOracleConn()
Err.Clear
On Error Goto ConnectionError
g_sConnectionString = "Driver={Microsoft ODBC for Oracle}; " _
& "SERVER=" & "MyHost" _
& ";UID=" & "MyUserID" _
& ";PWD=" & "MyPassword & ";"
Set g_oConn = New ADODB.Connection
g_oConn.Open g_sConnectionString '<-- fails here
Exit Sub
ConnectionError:
If Err.Number <> 0 Then
'Clean up from the error
End If
End Sub
–
–
The problem entirely relates to where Visual Basic 6 is installed. By default it is installed in C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE
If you change its location to something like:
C:\ProgramFilesX86\Microsoft Visual Studio\VB98\VB6.EXE
It runs properly.
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.