Looking for script to add data source node to ODBC - odbc

I'm making installation script and I'm using ODBC, how can I automatically add a node to ODBC Data Sources.
Building installer with Visual Studio setup project, but I'm able to run any script for it.
Thank you.

1)
ODBC Data Sources are typically defined in registry entries - located at -
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI...... (DSNs on 32bit Windows or 64bit Windows)
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI...... (DSNs on 64bit Windows for 32bit Drivers)
That part of the registry contains the "System" DSNs - HKEY_CURRENT_USER contains "User" DSNs.
Of course, all drivers are different so there may be additional stuff required elsewhere too...
2)
You could also consider using File DSNs and ship the fie with the installer.
3)
You could also consider a DSN'less connection - but this would depend on how the ODBC application is coded.

Related

ODBC connection to ACCDB in web.config

Want to connect to ACCDB file as an ODBC (rather than OleDb) data source in ASP.NET but struggling with the connection string. As I plan to deploy the web app from Visual Studio 2019 to Azure, I need something that can make the journey.
Here's what I tried from connectionstrings.com (I discovered not all of those strings are up to date or necessarily convenient for insertion to web.config):
Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=C:\mydatabase.accdb;Uid=Admin;Pwd=;
This returns keyword not supported: driver from IIS Express where I'm doing development.
Hum, that looks ok:
I would suggest this:
Driver={Microsoft Access Driver (*.mdb, *.accdb)};
dbq=C:\test\test44.accdb;driverid=25;fil=MS Access;
maxbuffersize=2048;maxscanrows=8;pagetimeout=5;safetransactions=0;
threads=3;uid=admin;usercommitsync=Yes
the above is what the connection builder in Visual Studio spits out.
and you have Dbq - carefull - caps I believe matters - so try dbq.
Next up:
HUGE HUGE elephant in the room.
are you using a x32 bit driver, or the x64 bit one? YOU MUST match your project bit size (code compile) settings to the driver (YOU MUST!!!).
So this:
you MUST set and force your project to run as x32 bits. (or perhaps install the x64 bit version of Access drivers. AND BE careful. If you are running the x64 bit versions of the drivers, and use Test connection with Visual Studio? It will always fail since VS runs as a x32 bit applcation. you MUST RUN the applcation to test the connection - NOT use test connection with VS connection builders (you might not be using them, but if you are, just trying to save you a day of work wasted).
so, create a x32 config project. And thus this now:
And I assume your sample connection using c: or "root" of the drive is a JUST a example, since most windows now don't allow a file to be used directly from c: root location.

How to setup 64-bit ODBC data source in UiPath?

I am trying to set up a 64-bit ODBC data source connection in UiPath, but it's not visible and only showing 32-bit data sources.
Is it because UiPath is a 32-bit software? Please suggest an alternate workaround.
A 32-bit application can only load 32-bit ODBC drivers.
Your options are to --
find a 64-bit version of your "UiPath" application
find a 32-bit version of the 64-bit "Oracle in XE" driver
find a 32-bit ODBC Driver for 64-bit ODBC Data Sources (such as this, from my employer, available for immediate download with free two-week trial license)
Connect activity in UiPath drops down only 32bit data sources. I solved this using following method.
Go to Oracle official website and download Oracle Instant Client 32
bit. (Link1)
Download Basic Package (in Base section), SDK Package and ODBC
Package (in Develpoment and Runtime section).
Extract them in a directory.
There will be folder created similar to instantclient_19_3. Open this
folder and run odbc_install.exe (Might prompt for administrator
privilegs)
Sometimes there might be messages stating that "This program is not
installed correctly". Ignore this message.
That's all. Create a data source using ODBC Data Source Administrator Application(32 bit) in Windows machine.There you will be able to create an Oracle data source using Oracle instantclient_19_3 driver.
Refer image
After successful creation of this data source, now you will be able to see your data source from UiPath Connect activity.

The QPSQL driver can not loaded

if i try to run my qt application on windows 7, the console print:
QPSQL driver not loaded ... available driver:...QPSQL...
After that, i've tried to include the following paths to the windows path variable
C:\psql32\bin;C:\psql32\include;C:\psql32\lib;
The application can connect to the psql db and all works fine. How can i fix this problem, without to install the psql software on all pc's. ?
Best regards, chris.
Usually you don't need to use the drivers from Postgres. At least in the version I use (commercial, 4.8.4, Win)
Qt provides the drivers in the directory <QTDIR>\plugins\sqldrivers.
When the application runs on the computer, where Qt is installed, nothing should be done explicitly - Qt should find the drivers.
When the application is deployed on a computer without Qt-installation, I copy release versions of the files found in <QTDIR>\plugins to <MyAppExeDir>\plugins.
Besides Sql drivers, same problem could apply also to jpeg an other pluggable components.
P.S.:
Make sure, not to mix Qt-dlls from one computer with Qt-plugins from other computer, even if the versions are the same.

Adaptive server anywhere ASA SqlAnywhere 8.0 ODBC driver

Well, I've searched the interwebs like crazy and I am unable to find this driver.
I am trying to convert data from a client's database that was built using the ASA 8.0 engine. ASA 8 has been out of support since 2008. The software company that created this no longer supports it, so can't provide me with the drivers. I've scoured the web and can't find anything.
I managed to get the installation files for this old software called BailCredit built by a company called SentryLink. I found what I presume to be the ODBC driver in the installation files (dbodbc8.dll) and I've tried manually registering that (Windows Server 2008 R2) but didn't get anywhere. When I try to create a new datasource, the ODBC Data Source Administrator gives me an error.
My company has done hundreds of data migrations and this is the first time I've had to resort to this.
I'd post a link to the database file, but simply can't because of privacy.
Please help if you can! Thanks in Advance.
Matt
For 64 Bit operating system you need to copy the dll's to %windir%\syswow64\ so you need to change install.cmd to the following code. The rest is the same.
COPY %~dp0dbcon8.dll %windir%\syswow64\dbcon8.dll
COPY %~dp0dblgen8.dll %windir%\syswow64\dblgen8.dll
COPY %~dp0dbodbc8.dll %windir%\syswow64\dbodbc8.dll
regedit %~dp0SAS8.REG
pause
It take's me a few hours to figure it out i hope it help someone else.
This is how I finally solved it.
OPTION 1:
Get a copy of the following files from a computer with a working setup of the SQL Anywhere ODBC driver:
dbodbc8.dll
dbcon8.dll
dblgen8.dll
Create an install.cmd file with this:
COPY %~dp0dbcon8.dll %SystemRoot%\system32\dbcon8.dll
COPY %~dp0dblgen8.dll %SystemRoot%\system32\dblgen8.dll
COPY %~dp0dbodbc8.dll %SystemRoot%\system32\dbodbc8.dll
regedit %~dp0SAS8.REG
pause
Create an SAS8.REG file with this:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Adaptive Server Anywhere 8.0]
"Driver"=hex(2):25,00,57,00,49,00,4e,00,44,00,49,00,52,00,25,00,5c,00,73,00,79,\
00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,62,00,6f,00,64,00,62,00,\
63,00,38,00,2e,00,64,00,6c,00,6c,00,00,00
"Setup"=hex(2):25,00,57,00,49,00,4e,00,44,00,49,00,52,00,25,00,5c,00,73,00,79,\
00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,62,00,6f,00,64,00,62,00,\
63,00,38,00,2e,00,64,00,6c,00,6c,00,00,00
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]
"Adaptive Server Anywhere 8.0"="Installed"
Run install.cmd
This will work when Windows is installed in C:\WINDOWS, otherwise edit the registry entries.
OPTION 2:
If someone left a copy of the Powerbuilder CD in the client's computer, look for the folder asa801runtime and install that to get the ODBC driver working
EDIT:
Example connection string with default username/password:
Driver={Adaptive Server Anywhere 8.0};UID=dba;PWD=sql;DatabaseName=base;EngineName=gestion;CommLinks=TCPIP(HOST=GRA06:2638)
Answering my own question:
I wasn't able to find this commercially available anywhere. I happened to be able to get my hands on the installation for the software package that was using SQLAnywhere 8. By installing this, it installed the necessary drivers (but only worked on 32-bit OS).

JET and ODBC driver missing, can not get data from MDBs

These are MY symptoms: (XP Pro, 32bit)
-Programs that access .mdb databases (aside from Access 2007 itself) can not get any data.
-Using the Data Sources in Visual Studio 2008 to connect to an MDB shows tables, but you can not query. you receive "Unknown Error" from the Microsoft JET Database Engine
-ArcCatalog can not read a personal geodatabase (mdb), after opening the database it has no feature classes within it
-Trying to bring up the properties of a User DSN "MS Access Database" in the ODBC Data Source Administrator returns error
"The setup routines for the Microsoft Access Driver (*.mdb, *.accdb) ODBC driver could not be found. Please reinstall the driver."
I attempted to reinstall latest MDAC (by setting it to compatibility mode of windows 2000) and latest JET driver. Reinstalled XP SP3.
Also tried a lot of regsvr32 gymnastics with the dao350.dll and dao360.dll, uninstalled the dao350, etc, etc. Nothing worked.
(Yes, I'm answering my own question, to record my solution)
I should also note, in addition to above, I couldn't use the SQL Native Client driver either.
In the registry, under HKLM\SOFTWARE\ODBC the \ODBC.INI branch contains any defined connections, and the \ODBCINST.INI contains records for the installed drivers.
I checked a similar development machine, and my ODBCINST.INI was missing A LOT of entries. I blame the ccleaner application that was recently used to clean up my system of junk.
After exporting the registry branch from the other computer, and importing over my existing keys, everything worked again.
Below are some of the core records, to generate a .reg script. You should get the full list from a similar machine to yours.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI]
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Microsoft Access Driver (*.mdb)]
"UsageCount"=dword:00000002
"Driver"="C:\\WINDOWS\\system32\\odbcjt32.dll"
"Setup"="C:\\WINDOWS\\system32\\odbcjt32.dll"
"APILevel"="1"
"ConnectFunctions"="YYN"
"DriverODBCVer"="02.50"
"FileUsage"="2"
"FileExtns"="*.mdb"
"SQLLevel"="0"
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Microsoft Access Driver (*.mdb, *.accdb)]
"UsageCount"=dword:00000003
"Driver"="C:\\PROGRA~1\\COMMON~1\\MICROS~1\\OFFICE12\\ACEODBC.DLL"
"Setup"="C:\\PROGRA~1\\COMMON~1\\MICROS~1\\OFFICE12\\ACEODBC.DLL"
"APILevel"="1"
"ConnectFunctions"="YYN"
"DriverODBCVer"="02.50"
"FileUsage"="2"
"FileExtns"="*.mdb,*.accdb"
"SQLLevel"="0"
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Microsoft Excel Driver (*.xls)]
"UsageCount"=dword:00000002
"Driver"="C:\\WINDOWS\\system32\\odbcjt32.dll"
"Setup"="C:\\WINDOWS\\system32\\odexl32.dll"
"APILevel"="1"
"ConnectFunctions"="YYN"
"DriverODBCVer"="02.50"
"FileUsage"="1"
"FileExtns"="*.xls"
"SQLLevel"="0"
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)]
"UsageCount"=dword:00000003
"Driver"="C:\\PROGRA~1\\COMMON~1\\MICROS~1\\OFFICE12\\ACEODBC.DLL"
"Setup"="C:\\PROGRA~1\\COMMON~1\\MICROS~1\\OFFICE12\\ACEODEXL.DLL"
"APILevel"="1"
"ConnectFunctions"="YYN"
"DriverODBCVer"="02.50"
"FileUsage"="2"
"FileExtns"="*.xls,*.xlsx, *.xlsb"
"SQLLevel"="0"
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\SQL Native Client]
"UsageCount"=dword:00000001
"Driver"="c:\\WINDOWS\\system32\\sqlncli.dll"
"Setup"="c:\\WINDOWS\\system32\\sqlncli.dll"
"APILevel"="2"
"ConnectFunctions"="YYY"
"CPTimeout"="60"
"DriverODBCVer"="09.00"
"FileUsage"="0"
"SQLLevel"="1"
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\SQL Server]
"UsageCount"=dword:00000002
"Driver"="C:\\WINDOWS\\system32\\SQLSRV32.dll"
"Setup"="C:\\WINDOWS\\system32\\sqlsrv32.dll"
"SQLLevel"="1"
"FileUsage"="0"
"DriverODBCVer"="03.50"
"ConnectFunctions"="YYY"
"APILevel"="2"
"CPTimeout"="60"

Resources