I'm having problem with ODBC and an application written with Visual Basic 6 (so it's 32-bit). It seems that the ODBC library of VB6 is not compatible with the 64-bit ODBC of Windows 7.
The error code returned is -2147220992 and it's rambling about incompatible architectures.
Can I install a 32-bit version of ODBC? Or any other alternatives?
use the 32-bit odbc manager to add your DSN:
C:\Windows\SysWOW64\odbcad32.exe
that should be able to see the 32-bit odbc driver.
You need to use the 32 bit version of ODBC. You can't mix 32 and 64 bit code in the same process.
However, that may not be your problem. That error code is, I think, CONNECT_E_NOCONNECTION and there could be all sorts of reasons why you get that, and no necessarily down to 32/64 bit driver issues. For example, did you define the ODBC connection (DSN) with 32 bit admin tools?
Finally, I would recommend that you quote precise error messages rather than using phrases like "rambling about incompatible architectures". Precise information will help track down the problem.
As mentioned above:
C:\windows\SysWow64\odbcad32.exe is the location for the 32-bit version of the ODBC Administrator.
Related
we upgraded a user to windows 10 and we are having issues configuring the ODBC connect with Oracle.
We got both the 64bit and 32bit drivers installed. I know the OBDC for 32bit is syswow64 and 64bit is on the system32.
I guess the user has two version of the same application. One uses the 64bit drivers and the other version uses the 32bit driver. They both use the same name inside the obdc connect. When we try to add the 32bit connection it overwrites the 64bit connection. I'm guessing because its the same name.
Is there a way to add two odbc connections with the same name, but one being a 32bit and the other being a 64bit?
The user say you have to map the two drivers together and something and about using the odac oracle install. When i installed i just uses the oracle client install as administrator. The oracle version is 12.2
When I've had this issue, I've had to set up two versions of the driver and reference them independently. I'll have "Oracle32" and "Oracle64" and then reference the one the application calls for. I hope that helps!
In earlier Oracle versions by default both drivers had the same name and the ORACLE_HOME were equal, e.g. OraClient11g_home1.
Now in Oracle 12 or newer this changed by default to OraClient12Home1_32bit and OraClient12Home1
I assume you can simply rename the ODBC driver in registry, i.e.
HKLM\SOFTWARE\WOW6432Node\ODBC\ODBCINST.INI\Oracle in OraClient12Home1_32bit rename key to Oracle in OraClient12Home
HKLM\SOFTWARE\WOW6432Node\ODBC\ODBCINST.INI\ODBC Drivers\Oracle in OraClient12Home1_32bit rename to Oracle in OraClient12Home1
As far as I know when you add a "User DSN" then the DSN is platform independent, i.e. tries to load the 32/64 bit driver depending on the invoking process. Thus, if you add the same DSN again, it will overwrite the existing one. In order to determine the platform you have to add a "System DSN".
This answer may help you for installation: BadImageFormatException. This will occur when running in 64 bit mode with the 32 bit Oracle client components installed
I currently have a 32-bit PowerBuilder application that we are trying to port over to a Windows 7 64-bit environment. Realizing the obvious that PowerBuilder 10.5 was built previously before Window7 came out and the big also the obvious fact that this application was built within a Windows XP 32-bit environment.
The 32-bit PowerBuilder application spits out the following error message when deployed on a Windows 7 64-bit machine.
Application Terminated. Error: Invalid DataWindow row/column specified at line 44 in function ivvisiblecolumn of object objectwindow
The database profile setup points to an OLEDB and the backend database is MSSQL 2008. Currently the application does run on the Windows7 64-bit environment and seems to be working in an inquiry mode only. Meaning we can read some of the records on the datawindow, but as soon as you try to make a transaction it blows up.
My question is - Is it possible to get a 32-bit app working in a 64-bit environment?
So far the client is asking to come up with possible solutions without the idea of upgrading to PowerBuilder 12.5. Essentially they want to stay at 10.5 but yet get the app working from a 32-bit environment to a 64-bit...apples to oranges if you know what I mean. Further investigation is needed into whether the code will not function in 64bit or dll issues with powerbuilder client runtime in 64bit. They are really trying to stay away from any app rewrite since the application is older than when Christ was a carpenter. The app was originally built in PB 6.5 I think.
So far I have the following ideas but I am new to this:
- I understand that Windows 7 comes with a virtual machine IIRC. I think it's called WOW64. Is it possible to create a virtual on a server and have the users run a 32-bit application inside a 64-bit machine? Then create a shortcut of somekind for the user to simply click on?
We do have a virtual XP machine and a virtual Windows7 64 bit machine for testing. PowerBuilder 10.5 actually installed on Windows 7 and seems to be working fine. However running the application in run mode or debug causes many errors as you can imagine.
The application has been built in XP and run on Windows 7, but the results yeild the above error message.
I have not looked yet into the Run under Compatibility mode, but I am told by the team it will not work.
I have not looked at UAC or ALC User management yet. Could that be something affecting the 64-bit system?
I know this is app unrelated but...I have seen in some cases 32-bit applications work in a windows 64-bit environment by simply targeting certain DLL files. An example case is Microsoft Flight Simulator X where the 32-bit game would crash in windows 7 64-bit. The solution for that was to simply go get a Vista 64-bit DLL file called uiautomationcore.dll and copy that into the windows environment. The Games also have to be installed on the root of C: in order to work.
Does anyone have any recommendations on how I can approach this problem?
I apologize If I'm vague in my notes here.
UPDATE: Has anyone had any experience with PB 10.5 runtime files on a 64 bit machine? I am wondering if the powerbuilder client runtime is installing its dlls into the correct location of the application C:\XXX or can't find it? Wondering how to approach this.
Basically nothing should prevent a 10.5 PB app to run on Win7/64. I develop and run several products in PB11.5 (also a 32bit IDE) on a win7/64. And btw, some older PB like 9 still run on Win7, so is likely PB6.5. The problem must be elsewhere, relative to the app design.
WoW64 (and Wow6432Node in the registry) is not a true VM, it's a bunch of services and system API hooked with fallbacks for 32 bit applications (and legacy applications that do not conform to the novelties introduced since Vista)
Error: Invalid DataWindow row/column specified at line 44 in function ivvisiblecolumn of object objectwindow sounds typically like an incorrectly handled return value (where a computed row number is getting negative or null before trying to access a property or data at that given invalid row), or it could be relative to the way to get back an autoincrement value from the db after an insert
beware of the UAC management that could lead to unexpected behavior with legacy application, especially if the application is using a database: the UAC guidelines tells not to install data managed by the application in the Program Files folder that is now Read only (since Vista - that guideline is since XP). Instead you must put that into a ProgramData sub-directory if it is accessible by everyone and into a user local AppData if the data is just for the current user. Win7/Vista can silently conforms to the standard by duplicating the data locally to the user (in the Users\username\AppData\Local\VirtualStore) while still pretending to the application that it is currently accessing it from Program Files...
you could give a try with Dependency Walker to look for the incorrect dll problems
We moved many of our applications to Windows 7 64bit. The only issue we ran into was with the database connections. You are running a 32bit application so you need to connect to 32bit database. If you bring up "Data Sources (ODBC)" from the control panel, you will be looking at the 64 bit entries. You need to use the 32 bit ODBC found in "C:\Windows\SysWOW64\odbcad32.exe". The Registry entries you need are in the following locations...
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI\ODBC Drivers
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources
or
HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI
HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI\ODBC Drivers
HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\ODBC\ODBC.INI
HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources
I want to connect an ASP application with my Oracle database, and i've readed that I have to set up a connection with my Oracle DB with ODBC driver to achieve it.
The problem is, that when I create the new ODBC connection, it asks for the TNSNames, and my the connection that I have in my TNSNames.ora doesn't appear in the drop list (it appears empty).
Im trying to create the connection going to the ODBC configuration in Control Panel.
Someone has any idea on how can I solve this?
Thanks in advance,
Khor
Okay, I finally solved it.
What worked was creating a windows enviroment variable called TNS_ADMIN with the path to my admin folder on the oracle directory.
TNS_ADMIN: "C:\oracle\product\10.2.0\client_2\network\admin"
That solved the problem.
You probably use Win64.
If yes then you must configure ODBC DSN in the same Windows subsystem as Oracle. Check if you installed Oracle client in 32 or 64 bit version.
There are 2 version of odbcad32.exe in 64 bit versions of Windows. In c:\windows\system32 you will find 64 bit that configure ODBC for 64 bit applications and will use setting from 64 bit version of Oracle client. In c:\windows\syswow64 there is 32 bit version you should use to configure ODBC for 32 bit programs including 32 bit version of Oracle client.
I have a Win32 application that makes ODBC-Connections. We connect using SQLDriverConnect()
which displays a dialog to select the data source. In the x64-Version the Dialog shows and offers 2 different 32 Bit MS ACCESS Drivers. When i select one of these, in the 32 Bit version i would see a open file dialog to select a .mdb file. In the 64 Bit version the call to SQLDriverConnect() at this point returns with -1.
SQLError() returns: "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
Is it in general possible to use a 32 Bit ODBC Driver from a 64-Bit executable? Why are these driver shown? As far as i can find there is no 64 Bit MS Access OBDC driver so far. What can i do?
You absolutely cannot mix 32bit application and 64bit driver (or vice-versa).
Basically, an ODBC driver is, typically, a dll (windows) or a shared object (linux...) which is loaded by its parent application.
All executables, dlls, etc that share the same process space must be the same bit'ness...
In order to "bridge" from a 64bit application to a 32bit ODBC driver you would need to employ an ODBC to ODBC Bridge such as -
http://uda.openlinksw.com/odbc-odbc-mt/
This has a 64bit ODBC client component which connects vis sockets to 32bit server components. The server components bridge to a pre-configured 32bit Access ODBC DSN.
Client component can be either on the local machine or a server machine...
Well, I don't know why SQLDriverConnect() works the way you describe it, but perhaps this Blog post from Microsoft
http://blogs.msdn.com/b/psssql/archive/2010/01/21/how-to-get-a-x64-version-of-jet.aspx
can help you a little bit.
Seems there will be no native 64 bit ODBC driver for MS Access in near future, but those ACE components mentioned there may be an alternative.
You can't, but you have the alternative to compile your app in 32bits, and use the 32bit odbc driver. In my case, I use GoLang just change GOARCH environment variable SET GOARCH=386 then compile your project go build and your all set.
I've been trying to connect to a MS Access 2007 database through JDBC. My JDK is JDK 1.6u18 64-bit and OS is Windows 7 64-bit. But problem is I am unable to create a DSN using Windows\system32\odbcad32.exe because it doesn't show ODBC drivers for MS Access at all, it's only showing drivers for MS SQL Server.
When tried to click on Configure for "MS Access Database" (which is an already created DSN, I guess), it first shows error message : "The setup routines for the Microsoft Access Drivers (*.mdb, *.accdb) ODBC Driver could not be found. Please reinstall the driver."
And then another message : "Errors found! The specified DSN contains an architecture mismatch between the Driver and Application."
I cannot reinstall the MDAC as it doesn't work with Windows 7 (which comes with its own WDAC).
The odbcad32.exe in Windows\SysWOW64 does let me create a DSN for MS Access, it shows the drivers installed properly. However, when tried to connect to that DSN through a Java program, I get the following exception :
java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains
an architecture mismatch between the Driver and Application
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at AccessTest.main(AccessTest.java:19)
What might be the problem and what do I have to do to get it working? My OS as well as JDK are 64-bit. Can't I connect to a Access 2007 database, which I presume is 32-bit? Any help would be highly appreciated. Also, in case one thinks this's not a right place for this question, I apologize in advance. Then please guide me to appropriate forum.
Another option would be to find a third-party JDBC driver for MS Access. But I do need to know what's wrong with my configuration. :-/
PS : I know there're many better databases available out there, but for few unfortunate reasons, I have to use MS Access only and have to get it working.
Have you looked at Access 2010 drivers? They work with 64 bit from what I've read.
http://www.microsoft.com/downloads/details.aspx?FamilyID=C06B8369-60DD-4B64-A44B-84B371EDE16D&displaylang=ja&displaylang=en
I have had this problem for a while too and I finally found a solution, so here it is for everybody else.
In order to set up the ODBC connection, I had to use the 32 bit version of odbcad32.exe that you can find in c:\windows\sysWOW64\odbcad32.exe, just like you did. I got my information from here: http://msdn.microsoft.com/en-us/library/ms712362%28v=vs.85%29.aspx
Just like you, once I did this my connection still gave the architecture mismatch error.
I figured that since the driver was a 32 bit driver, I could try to run my app using the 32 bit JVM. So, I downloaded the JRE 6U26 32 bit version, and everything started working correctly.
I hope this helps.
If you get the error on JDBC when running Windows 7 as mentioned above, its the Java 64 bit you installed instead of sticking to 32 bit. So install Java 6 32 bit JVM and everything back to normal again. This is providing you are running normal 32 bit MS Access like you used to.
if your jvm is 64 bit, you need a 64 bit ODBC driver. Use the 64 bit odbc administrator that you access from control panel and define your data source there. It should work...