In windows computer I create a DSN for connecting a PI (from OISoft ) database and pull data in excel and others.
Now how can I make a DSN in linux or can use the DSN already created in that windows PC.
I think you need to refer to your ODBC library vendor's documentation and/or your ODBC driver vendor's documentation for details.
How these things are handled is very much dependent on how the library does it. You might stick a file somewhere or something.
Linux driver managers (unixODBC and iODBC are the free ones) both use the same configuration files: odbc.ini and odbcinst.ini (or .odbc.ini and .odbcinst.ini in your home directory)
odbc.ini is used to list DSNs:
[ODBC Data Sources]
MyDSN=MyDriver
[MyDSN]
Driver=MyDriver
Description=This is my DSN and its settings for connecting to MyDriver.
UID=TheUsername
PWD=ThePassword
SOMEOTHERSETTING=etc
odbcinst.ini is used to list Drivers:
[ODBC Drivers]
MyDriver=Installed
[MyDriver]
Driver=/path/to/driver.so
Description=This is my driver.
Both of these are analogous to the entries in the Windows registry at HKLM/Software/ODBC/ODBC.INI and HKLM/Software/ODBC/ODBCINST.INI so you can go and copy the values from there to setup your DSN in linux.
DSNs are a windows-only concept. There's no equivalent on Linux.
Related
When trying to make a program on Windows that connects to a database via ODBC, I got the following error:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
I'm sure my code is right. It even worked on a different PC.
Why am I getting this error? And How do I fix it?
What causes this error?
The error message tells you, simply put, that the ODBC Driver Manager could not find the driver you specified in your connection string or DSN.
This can have 3 common causes:
The driver you tried to use is not installed on your system
The driver is installed, however, it doesn't match bitness of the code you're running
You made an error in typing the driver name
How do I check which drivers are installed on my system?
You can check the drivers which are installed on your system by going to the ODBC Data Source Administrator. To open it, press ⊞ Win + R, and type in: odbcad32.exe. Then check the tab Drivers for installed drivers. The Name column indicates the exact name you should use in your connection string or DSN.
If you're on 64-bit Windows, that only lists the 64-bit drivers installed on
your system. To see which 32-bit drivers are installed, press press ⊞ Win + R, and type in: C:\Windows\SysWOW64\odbcad32.exe, and go to the Drivers tab again.
The driver is installed, but it might be the wrong bitness, what do I do?
Then, you have two choices, either adjust the bitness your program is running in, or install a driver with a different bitness.
Some of the drivers that are installed by default on Windows only have a 32-bits variant. These can't be used with 64-bits programs.
You can usually identify which bitness a program is running under in task manager. In Windows 10, all 32-bit programs have (32-bit) appended to their name. If that isn't there, you're likely running a 64-bit program, and most modern programming languages and environments run on 64-bit by default, but allow you to switch to 32-bit. However, the specifics for different programming languages are outside the scope of this question.
How can I verify I didn't mistype the driver name?
An ODBC connection string looks like this:
DRIVER={DriverName};ParameterName1=ParameterValue1;ParameterNameN=ParameterValueN;
The driver name part needs to be delimited by curly braces if it might contain special characters, and needs to exactly match the installed driver name, as found in the ODBC Data Source Administrator, including spaces and typographical characters, but excluding capitalization.
Note that for deployed code, the driver must be present on the computer/server running the code.
I don't have the driver, or have the wrong bitness, where do I get the right one?
That depends on which driver you want to use.
A list of common drivers with download locations (all 32-bit and 64-bit at the same URL):
The Microsoft ODBC Driver 17 for SQL Server
The Microsoft Access database driver, which is part of the Microsoft Access Database Engine. Note that simultaneous installations of 32-bit and 64-bit Access ODBC drivers are not supported.
The MySQL ODBC connector by Oracle
The open-source SQLite ODBC driver by Christian Werner (non-official)
psqlODBC, the official PostgreSQL driver
If the driver you want to use isn't listed, the location is usually easily found using Google.
In design mode, a value has been set to the property of
TFDConnection.ConnectionDefName must be empty.
After a lot research, I decided to ask the question here, therefore, I have not found the answer of how I can do this.
I have a system written in C/C ++ which was designed for Linux PowerPC64 BE ( at now, I'm using Debian ) servers, and I need to connect this system to an IBM DB2/400 database, my first choice was to use unixODBC, after searching I saw the need to use a lib. for db2, but I did not find this lib, and then I did not find any other alternatives on how to make that connection.
So, how I can make this connection ?
Linux ODBC drivers for Db2 for IBM i are available in two flavors...
Assuming you have a license for "Client Access", of which the most current incarnation is known as Access Client Solutions (ACS). The Linux ODBC driver is in the Linux Application Package.
IBM also offers a stand-a-lone product, Db2 Connect which provides connectivity to Db2 for Z/OS, DB2 for i, and Db2 for LUW.
For C/C++ you should be good with either. But for instance, the Python Db2 package expects Db2 Connect and doesn't work with the ACS Linux driver.
I deal with an ARSystem and I've been accessing the arserver data by ODBC communication using the AR System driver for Windows plataform. I would like to do the same on a linux plataform. My specifications to do the connection at the ODBC Manager Setup are:
Data Source Name
AR Server
User name
Password
(checked choices)
Replace '.' in object names
Use underscores
Is it possible? How can I do that?
Regards,
I don't believe there is an ARSystem ODBC driver for Linux. You could use an ODBC-ODBC Bridge to get at it from Linux.
Have you considered the JDBC Driver for Remedy or ARSPerl if it has to run in a shell. Both of those solutions can be run on Windows as well.
I want to connect to an Informix database using an ODBC connection from my web server.
Both Informix server and web server are implemented on different machines;
both system are using SuSE Linux.
I know very well how to create an ODBC connection on the same Informix server using unixODBC.
But I don't know how to create an ODBC connection from one Linux based machine to another machine where the Informix server is implemented.
If I use Windows 7 instead of Linux then Windows 7 provides ODBC connection template and there is also no problem in connectivity.
But how to do it with a client PC running Linux OS.
Please guide me.
If you can connect from one Linux machine to Informix database using ODBC then you have installed Informix ODBC client and one of ODBC managers. Such manager can be UnixODBC, Informix own manager or something else. On Linux those managers use odbc.ini and odbcinst.ini configuration files where you configure driver and connection.
Check how it is configured on Linux machine where it works: find those .ini files, check environmet variables (INFORMIXDIR and INFORMIXSQLHOSTS) and find ODBC manager (UnixODBC?). If you use UnixODBC then you can test connection with its isql utility.
Good info abour configuring Informix ODBC client on Linux can be found at: http://www.ibm.com/developerworks/data/library/techarticle/dm-1108odbcdrivermanager/
Does anyone know how to connect to oracle from an erlang client in linux? I guess ODBC drivers are required.
According to the Erlang documentation ODBC is the way to go.
There is an Erlang ODBC API which "should run on all Unix dialects including Linux.... But currently it is only tested for Solaris, Windows 2000, Windows XP and NT". Find out more.
There are ODBC drivers for Linux. If you're lucky your distro will already have one installed. Find out more.
==== Answer may be very useful if on Windows, but may contain helpful info for Linux as well =====Now, First of all, we need to download an oracle client or oracle Database itself and install it from here: http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html. Oracle installs and creates a folder called oracle (on windows). Inside this folder, you will find its $HOME folder normally: C:\oracle\product\10.2.0\db_1. If you are on windows therefore, when you access the ODBC Configurations by reading this: http://ozinisle.blogspot.com/2011/10/configuring-odbc-connection-for-oracle.html then you will create a new Data Source Name (DSN) of your choice. The steps roughly are as follows: 1. Select System DSN2. Create New Data Source3. Scroll Down to select Oracle in OraDB{Vsn}_home14. Specify the Username (UID), Password5. Note down the Driver name you have selected, Note down the Data Source Name you have entered.6. Test the connection and make sure windows says that its fine.
Now, after this, we go to erlang side. Look at this module, its should kick start you in communicating with oracle.
-module(oracle_client).
-compile(export_all).
-define(CONNECT_OPTIONS,[
{auto_commit,on},
{scrollable_cursors, off}
]).
-define(CONNECT_STRING,"DSN=data_source;UID=uid;PWD=password;DRIVER=Oracle in OraDb10g_home1").connect()->
odbc:start(),
try odbc:connect(?CONNECT_STRING,?CONNECT_OPTIONS) of
{ok,ConnObject} -> {true,ConnObject};
Any -> {error,Any}
catch
E:E2 -> {exception,{E,E2}}
end.
send_sql(ConnObject, SQLQuery)-> odbc:sql_query(ConnObject, SQLQuery).
Erlang ODBC server must be running first. Erlang ODBC will ask you for a connection string and options. In the options first of all note that most Oracle drivers will need those scrollable cursors off. Then, in the connection string, you will be required to enter valid UID (username), password, DSN (Data source name) and the driver name, all these exactly the way you created the DSN in windows ODBC connection in the steps above.That should be okay. Note that you should stick to oracle drivers them selves and avoid third party ODBC Oracle drivers. I have, from experience suffered from using other third party drivers because after say, 10 million connections, the driver starts asking for money/License and blocks your traffic from reaching oracle DB.Let me know in case you get any challenges. The module above is a bit rough, do not use as is because its just a shell testing module, otherwise you will need say a gen_server which will hold the Connection Object so that other processing just keep communicating with it. As long as you are successful in setting up the Data Source Name with the installed Oracle DB or client on your machine, then this module will help you otherwise most challenges are in setting up the ODBC Connection.=== Linux === For Linux, i guess you need to get odbc libraries like Easy Soft ODBC Drivers, or UnixODBC. Then try to set it up as we did with windows above, and then use the Erlang module i have provided above. It should still work. I am afraid i have always connected to oracle from Windows and NOT Linux due to many challenges in setting up and configuring ODBC libraries (give it a shot, you may be succesful in setting up Unix ODBC or Easy Soft ODBC libraries), Otherwise, the Erlang part of it is sorted out.