ADODB Connection fails on Windows10 64 bit with SQL Server 2012 - windows

Our VB6 application currently is deployed on Windows 7 32-Bit with SQL Server 2008 and is working fine.
We are recently in process of migrating to Windows 10 64-bit with SQL Server 2012 and the following throws an error:
Set conn = CreateObject("ADODB.Connection")
conn.CommandTimeout = 3600 ' 1 hour
conn.Open "DSN=MYDSN" => Error occurs here
The DSN has been tested independently and connects to SQL server fine.
The error:
DNS data=Sql Server & 32 bit or 64 bit of ODBC Datasource:
3709, connection cannot be used to perform this operation. It is either closed or invalid in this context.
DNS data source=SQL Server Native Client 11& 32 bit ODBC Datasource:
3709, connection cannot be used to perform this operation. It is either closed or invalid in this context
DNS data source: SQL Server Native Client 11 & 64 bit ODBC Datasource:
-2147217843, [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot open database "ClientDatabase" requested by the login. The login failed
Any input is appreciated.

I had the same issue. My ADODB connection didn't work after I run the same Excel workbook with VBA on a new Windows 10 install. Then I remembered that the same happened when I moved to Windows 8.1 from Windows 7.
The solution on both cases was that the 64-bit version of ODBC simply didn't work out of the box (I don't know why and honestly I didn't bother to debug this).
I know you said you tried the 32-bit version but did you really remove all traces of the 64-bit before trying the 32-bit? Apparently they conflict with each other.
Try this steps:
Remove any 64-bit DSN which uses the relevant 64-bit ODBC driver. Do
this from ODBC Data Sources (64-bit) Control Panel
Uninstall the 64-bit driver.
Install the 32-bit driver.
Configure DSN (obviously from ODBC Data Sources (32-bit) Control
Panel)
Try again...
My problem was with VBA in Excel and the connection used MySQL ODBC Driver to connect to MySql DB but it might be the same issue.

Related

moving oracle client from win7/32 to win10/64

I'm trying to set up the Oracle instant client ODBC driver on Windows 10 because we're moving applications from Windows 7 / 32 bit to Windows 10 / 64 bit. The Windows 7 platform works using the Microsoft ODBC Driver for Oracle but that driver is deprecated. So I'm trying to install the 64 bit Oracle instant client. When trying to connect, I'm getting a TNS adapter protocol error. Every search that I've done leads me to solutions around checking the server but the server is working fine in the enterprise. I don't have an actual Oracle client installed, just the ODBC driver. Using the following connection string
Driver={Oracle in instantclient_11_2};Server=(DESCRIPTION=(ADDRESS=(PROTOCOL = TCP)(HOST = redacted)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SID=redacted))); Uid=redacted;Pwd=redacted;
Which client application do you use?
If this is a 32-bit application (which seems to be the case because before you used the Microsoft ODBC Driver which exist only for 32-bit) then the ODBC driver must be also 32-bit! You cannot mix the architectures.
Of course you can install 32-bit applications/drivers on a 64-bit Windows.
The ODBC driver requires and Oracle client, however it looks like you installed it already.
Remove the space character from the connection string.
If you need to install both, the 32-bit and the 64-bit ODBC driver, follow this instruction: BadImageFormatException. This will occur when running in 64 bit mode with the 32 bit Oracle client components installed
I solved the issue.
I created an ODBC data source for the connections I want to use and altered the connection strings to
dsn=redacted;uid=redacted;pwd=redacted
Also installed tnsnames.ora in c:\oracle\instantclient_19_10\network\admin\ directory and set TNS_ADMIN system environment variable to c:\oracle\instantclient_19_10

Oracle Error - Failed: no ocijdbc19 in java.library.path

I have a PC with many connections, all runs correctly.
I received a new PC Win 10, I work via Cisco Any Connect from home.
I install SQL Developer 20.2 and 19.4 (same version of my old PC), I import my connections (about 15), only 2 connections send me "Success" during a test, all the others give me this error:
Failed: no ocijdbc19 in java.library.path
I install also PostgreSQL jdbc and the server is connected correctly.
The difference between the two PC is that in my old PC I had also installed XE and some odbc drivers to use with others products.
Thanks

microsoft odbc driver manager the specified dsn contains an architecture miss match between driver and application

I'm new to informatica, I have installed informatica 9.5.1 htfix2 on my lappy with
config: Win 7 64 bit os, Oracle 11g,Informatica 9.5.1 htfix2.
After all successfull configurations when i started workflow manager to import tables from Oracle DB i have faced below error "[microsoft odbc driver manager] the specified dsn contains an architecture mismatch between driver and application"
can anyone help me to resolve this issue.
I bet you are using the 64 bit ODBC driver. Remove the DSN from 64 bit and add it in the 32-bit (odbcad32.exe).
Source
I have found the solution after working for seven to eight hours. I feel dumb at its simplicity :p.
Go to Control Panel > Administrative Tools
Open ODBC Data Sources (32-bit). In Users DSN add Data Direct 6.1 Oracle Wire Protocol.
Enter the respective details. E.g. if you are installing on your own system:
Host: localhost
Port: 1521
Service: XE (For Oracle or dependent on database)
Click OK and you are good to access tables on 64 bit Oracle through Informatica designer (32 Bit).
I removed the DSN
I uninstalled Oracle client and reinstalled it clean and perfect.
Recreated the DSN and tested it.
It started working.

TNSNames.ora doesn't appear when setting up a oracle odbc driver connection

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.

Can i use a 32 Bit ODBC Driver for my 64 Bit app

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.

Resources