ODBC connection Fail VB6 - database

I am working on a legacy VB6 application and I am running into problems with database connection.
I recieve these two errors in respective order:
and
and the break happens on this line:
I made sure that I tried the connection in the ODBC 64bit tool and the 32bit tool. same results
Any suggestions of what to try next?

You need to use the 32 bit version of ODBC. You can't mix 32 and 64 bit code in the same process.
Use the 32-bit odbc manager to configure your ODBC source:
C:\Windows\SysWOW64\odbcad32.exe

Related

ODBC Connection not appearing SSIS

I have a System DSN ODBC driver configured correctly on a server (the connection has been tested and works fine).
I've got an SSIS package, and when I try to create an ODBC connection manager, I can't find my ODBC connection in the drop down of data sources.
I've tried refreshing the list, closing and re-opening the solution, even re-creating the solution.
Has anyone experienced this before and if so how did you resolve it?
Many thanks
Most likely you have configured the system DNS on a 64-bit Windows, but the SSIS package runs in a 32-bit environment.
System DSNs will only be seen by the applications and tools which can
use them -- 32-bit DSNs for 32-bit applications, and 64-bit DSNs for
64-bit applications. Source
For reference, the ODBC Administrator Window can be found in the following locations on a 64-bit environment.
C:\Windows\System32\odbcad32.exe (64-bit ODBC Administrator)
C:\Windows\SysWoW64\odbcad32.exe (32-bit ODBC Administrator)

How to tell which driver is being used by SQL Server?

I have "inherited" a computer that has multiple ODBC driver's installed on it. Before I go removing anything, how do I tell which driver SQL Server is actually using? Does it just use the most updated one?
I am running SQL Server 2014, version 12.0.5207.0 (64 bit). I am also using SQL Server Management Studio 2017, version 17.5.
Additional question - I am planning to update the ODBC driver to 13.1, would I install the 64 bit since the server is 64 bit? When I look at the ODBC data sources the drivers are installed in both the 32-bit and 64-bit dialogues, so I am a bit confused. Total noob question, I realize, but I am very new to this.
That's not an easy answer. Let's break it into parts.
What driver is being used? The one the application requests. A driver is used by a client application to connect to the server, and the client application is the one that has the final say. You can look at the ODBC data sources configured in the machine to see the driver, but an application might not use an ODBC data source and instead embed the driver name into the application or some configuration file.
How can you tell? One way is to uninstall a driver and see what breaks. Usually not a good plan. Maybe you can use Process Monitor and check if any process load the drivers, but not Always feasible. If in doubt, leave the drivers alone. They are usually small and don't tend to cause trouble on their own.
As for SQL Server database engine and SQL Server Management Studio (SSMS), they normally don't use ODBC drivers. SSMS uses a .NET provider to connect to SQL Server. SQL Server database engine can use an ODBC driver if you have a linked server to another server.
If this is a database server and not an application server, chances are most drivers are rarelly used. If this is an application server, I'd leave the drivers alone. If it's a workstation, probably leave them alone too.
As for the new driver version, you need the 64-bit package to install, and it will install both 32 and 64-bit drivers. The reason is a 32-bit need a 32-bit driver, and a 64-bit application need a 64-bit driver. It's not the server bitness that matter in this case.

SQL Server: creating linked server to Access DB fails with Error 7403

On SQL Srver 2012R2 Express I created a linked server to Access 2010 32bit DB to IMPORT data from Access to SQL-server.
But when I run a query
SELECT * FROM OPENQUERY(MSAccessConnect, 'SELECT * FROM [myAccesstable]')
I get error 7403: 'Microsoft.ACE.OLEDB.12.0' provider not registered.
Same with 'Microsoft. Jet.OLEDB.4.0' btw.
What I found out so far is that I have NO such driver for 64 bit Version installed, but only the 32 bit version, as Access is 32 bit.
So how can I install the 64 bit verison of that driver?
Where can I find the driver (is this "AccessDatabaseEngine_X64.exe" ??)?
And am I sure, that the 32bit driver is not deleted or overwritten?
I may not "harm" my Office 2010 32bit installation, as there are to many things depending on 32 bit!!
The thing, which makes me wonder is, when using the import wizzard in SSMS it works, but when trying it with a linked server it fails.
So somehow in the wizzard it works without the correct driver, I guess.
Thanks your help
Michael

SQL Server 2012 connectivity to Oracle

I am trying to copy data from Oracle to SQL Server 2012, and I get the following message when selecting Data Source as Microsoft OLE DB Provider for Oracle:
Test connection failed because of an error in initializing provider.
Oracle client and network components were not found. These components
are supplied by Oracle Corporation and are part of the Oracle Version
7.3.3 or later client software installation.
I tried using .NET Framework Data Provider for Oracle and I get:
Attempt to load Oracle client libraries threw BadImageFormatException.
This problem will occur when running in 64 bit mode with the 32 bit
Oracle client components installed (system.data.oracleclient).
In SQL Server 2000 (which I am trying to move to SQL Server 2012/2014), I have the option of selection Oracle in OraClienthome directly.
Some additional information that may help diagnose the problem:
Using Toad 64 bit, it points to the 64 bit Oracle download; however, I can not tell if it is using a 32 bit driver or 64 bit driver. I can also run queries, etc. without issue.
ODBC, I can see Oracle when making a 32 (I am guessing) bit ODBC connection named Oracle in OraClienthome, but not in SysWOW64 odbc connection.
I successfully established a linked server connection on a server running 64 Bit SQL Server 2012. OraOLEDB.oracle shows up under Server Objects  Linked_Server  Providers
While creating an SSIS package, I am unable to establish a connection to Oracle.
I can successfully run queries in MS Access and Excel.
(NEW) I can copy files using Import Export Data 64 bit, but not 32 Bit.
Any help would be greatly appreciated!
In many cases the 64 bit drivers are not compatible and you have to install the 32 bit drivers then be sure you are selecting to use the 32 bit drivers if you create a job to run the package which is in the command options as the last check box. I also use toad to pull data from oracle on my desktop and it works fine with the 64 bit driver but on our new server I had to install the 32 bit drivers even though I was able to create odbc connection with connection manager. Also had to reboot win server after instal before I could get it to take.
Try to install and use Oracle Client on the MS site, and transfer the data using SSIS.
I got same problems, but when i've used connection using oracle client (you will see it in connection selection options) all worked ok.
Good luck!

SSIS Package Runs in BIDS but fails with an Architecture Mismatch in SQL Agent

I have an SSIS package that uses an ODBC connection to a Progress database as a source using a 32-bit ODBC driver. This package runs perfectly within the confines of BIDS. However, when I run it using the SQL Agent, it fails with the error:
The specified DSN contains an architecture mismatch between the Driver
and Application.
I know that this is probably a result of it wanting a 64-bit ODBC driver for that connection, but I can't seem to get the 64-bit driver to work correctly within BIDS. Is there a trick that would allow me to use the 32-bit driver within SQL Agent and move on with my life?
I found my answer. Under the Execution Options in the Job Step Properties there is a checkbox at the very bottom --- "Use 32-bit Runtime." Simple enough!
Thanks for your help.
BIDS = your local box, 32 bits
SQL Agent = your server, 64 bits
is that right?
If yes, you will really need the correct driver.
This is from BOL:
Be sure to note that if you develop a package in a 32-bit environment
and want to run the package in a 64-bit environment, the connection
managers need to be 64-bit compliant. Some connection managers such as
Excel work in a 32-bit environment only.
Yuo can call 32bit DTEXEC directly with CmdExec. Point at 32bit DTEXEC.
C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\dtexec.exe

Resources