Questions tagged [odbc]

Open Database Connectivity (ODBC) provides a standard software interface for accessing database management systems (DBMS).

ODBC (Open Database Connectivity) is a standard C programming language middleware API for accessing database management systems (DBMS). The designers of ODBC aimed to make it independent of database systems and operating systems; an application written using ODBC can be ported to other platforms, both on the client and server side, with few changes to the data access code.

ODBC accomplishes DBMS independence by using an ODBC driver as a translation layer between the application and the DBMS. The application uses ODBC functions through an ODBC driver manager with which it is linked, and the driver passes the query to the DBMS.

An ODBC driver can be thought of as analogous to a printer or other driver, providing a standard set of functions for the application to use, and implementing DBMS-specific functionality. An application that can use ODBC is referred to as "ODBC-compliant".

Any ODBC-compliant application can access any DBMS for which a driver is installed. Drivers exist for all major DBMSs, many other data sources like address book systems and Microsoft Excel, and even for text or CSV files.

External links:

9481 questions
37
votes
8 answers

Connect PHP to IBM i (AS/400)

I've got an upcoming project wherein I will need to connect our website (PHP5/Apache 1.3/OpenBSD 4.1) to our back-end system running on an iSeries with OS400 V5R3 so that I can access some tables stored there. I've done some checking around but am…
dragonmantank
  • 15,243
  • 20
  • 84
  • 92
37
votes
7 answers

What does the SQL Server Error "String Data, Right Truncation" mean and how do I fix it?

We are doing some performance tests on our website and we are getting the following error a lot: *** 'C:\inetpub\foo.plex' log message at: 2008/10/07 13:19:58 DBD::ODBC::st execute failed: [Microsoft][SQL Native Client]String data, right truncation…
Frew Schmidt
  • 9,364
  • 16
  • 64
  • 86
36
votes
2 answers

What are the functional differences between iODBC and unixODBC?

There are two major Open Source platform independent implementation of the ODBC. It is iODBC and unixODBC. Considering Unix as ODBC user platform and feature-wise, what are the real practical differences between these two implementations?
mloskot
  • 37,086
  • 11
  • 109
  • 136
36
votes
4 answers

Excel: Use a cell value as a parameter for a SQL query

I'm using MS Excel to get data from a MySQL database through ODBC. I successfully get data using an SQL query. But now I want that query to be parameterized. So I wonder If it is possible to use a cell value (a spreadsheet cell) as a parameter for…
GetFree
  • 40,278
  • 18
  • 77
  • 104
31
votes
3 answers

Fetching UTF-8 text from MySQL in R returns "????"

I'm stuck trying to fetch UTF-8 text in a MySQL database from R. I'm running R on OS X (tried both via the GUI and command line), where the default locale is en_US.UTF-8, and no matter what I try, the query result shows "?" for all non-ASCII…
Daniel Dickison
  • 21,832
  • 13
  • 69
  • 89
30
votes
7 answers

how to catch specific pyodbc error message

I trid the following code, import pyodbc try: pyodbc.connect('DRIVER={%s};SERVER=%s;DATABASE=%s;UID=%s;PWD=%s' % (driver, server, database, uid, password)) except pyodbc.Error, err: logging.warn(err) The error message format i get is…
ashokadhikari
  • 1,182
  • 3
  • 15
  • 29
29
votes
9 answers

What is a privileged instruction?

I have added some code which compiles cleanly and have just received this Windows error: --------------------------- (MonTel Administrator) 2.12.7: MtAdmin.exe - Application Error --------------------------- The exception Privileged instruction. …
David L Morris
  • 1,461
  • 1
  • 12
  • 19
29
votes
4 answers

How to fix endless reboot loop installing Microsoft ODBC Driver 17 - message: A previous installation required a reboot of the machine for changes

Installing Microsoft® ODBC Driver 17 on windows 10. During the install, Microsoft ODBC Driver 17 for SQL Server setup stops and shows "A previous installation required a reboot of the machine for changes to take effect. To proceed, restart your…
washingon
  • 981
  • 2
  • 10
  • 20
29
votes
4 answers

ERROR : [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

While connecting .NET to sybase server I got this error message: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified This has worked properly before. System DSN with same details worked and data connection…
Amrita
28
votes
3 answers

How to bind parameters via ODBC C#?

I need to bind parameters on ODBC query from C#. This is the sample code, but VS tells me that there's one parameter missing. OdbcCommand cmd = conn.CreateCommand(); cmd.CommandText = "SELECT * FROM user WHERE id = @id"; cmd.Parameters.Add("@id",…
Emanuele Pavanello
  • 785
  • 1
  • 9
  • 22
27
votes
7 answers

How do I create an ODBC DSN entry using C#?

I'm working on a legacy application that has a C++ extended stored procedure. This xsproc uses ODBC to connect to the database, which means it requires a DSN to be configured. I'm updating the installer (created using Visual Studio 2008 setup…
Neil Barnwell
  • 41,080
  • 29
  • 148
  • 220
27
votes
3 answers

Connect PHP to MSSQL via PDO ODBC

When I execute this code: print_r(PDO::getAvailableDrivers()); It says I have the odbc driver available. Array ( [0] => mysql [1] => odbc [2] => sqlite ) However, when I try to use it like so: $handle = new…
user1477388
  • 20,790
  • 32
  • 144
  • 264
27
votes
1 answer

sql.h header file missing though unixODBC is installed

I am on an up-to-date Ubuntu 12.04 system. I have unixodbc (v2.2.14 from ubuntu repos), MySQL and its relevant drivers installed. Also connected to a valid DSN. Verified by issuing isql DBName UName passwd. I am trying to compile a C application…
Richard
  • 528
  • 1
  • 5
  • 15
26
votes
4 answers

'PDOException' with message 'SQLSTATE[22001]: String data, right truncated: 0

NOTE: I have narrowed this problem down to specifically PDO because I am able to successfully prepare and execute statements using the odbc_* functions. Why can't I bind this parameter to the PDO prepared statement? This works: $mssqldriver = 'ODBC…
Jeff Puckett
  • 37,464
  • 17
  • 118
  • 167
26
votes
3 answers

Connect to remote MySQL db from docker container

I'm working to containerize a Django 1.5.x application that connects to a MySQL DB on a separate server via ODBC: [mysql_default] database = DB_NAME driver = /usr/lib64/libmyodbc5.so server = REMOTE_DB_SERVER user = DB_USER password =…
Brendenw
  • 785
  • 1
  • 6
  • 22