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
13
votes
1 answer

Ruby connecting to SQL Server

I'm having troubles connecting Ruby to Microsoft SQL Server. I'm running Mac OS X, but the target environment is Ubuntu Linux. Here's what I've tried: Install unixODBC Install FreeTDS used the options --with-unixodbc=/usr/local/etc…
Ben Scheirman
  • 40,531
  • 21
  • 102
  • 137
13
votes
2 answers

How to bind data to SQLBindCol using ODBC Driver API using C++

I'm trying to create a custom ODBC driver using C++ for a Windows environment (like PostgreSQL, Simba, Firebird, etc.) since the ODBC API has multiple ODBC API methods by default. I established connections using DSN, and I'm able to execute the SQL…
13
votes
2 answers

C++ Access to SQL Server from Linux

I need to write some data to SQL Server database from Linux in C++. I found this sqlapi.com But I think, at first ODBC driver has to be installed and has to work. I folowed…
Meloun
  • 13,601
  • 17
  • 64
  • 93
13
votes
2 answers

Get Number of Rows from a Select statement

I have this: $dbh = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=$mdbFilename", $username, $password); $sql = "SELECT * FROM this_table"; $stmt = $dbh->query($sql); //num of rows? How do I get the number of rows returned…
Abs
  • 56,052
  • 101
  • 275
  • 409
13
votes
3 answers

How can I use one database connection object in whole application?

I have created this class which returns connection object. I have used MySQL database. public class Connect_db { public Connection getConnection(String db_name,String user_name,String password) { Connection con=null; …
Dhruv Kapatel
  • 873
  • 3
  • 14
  • 27
13
votes
5 answers

Nodejs ODBC Connection on Windows

I have a project that would be perfect for Node.js, but it has to connect to a ODBC database and it has to run on windows. I see ODBC modules for nodejs on linux, but not windows. Does anyone have any suggestions on how to do this?
Clint
  • 2,871
  • 2
  • 25
  • 28
13
votes
3 answers

Check if pyodbc connection is open or closed

I often get this error: ProgrammingError: The cursor's connection has been closed. Is there a way to check whether the connection I am using has been closed before I attempt to execute a query? I'm thinking of writing a wrapper to execute queries.…
cammil
  • 9,499
  • 15
  • 55
  • 89
12
votes
1 answer

Strange Oracle error: Identifier too long ORA-00972

I have faced this problem when working with ORACLE 10g. I read the answers given to this question here (ora-00972 identifier is too long oracle 10g) on stack overflow but they have not worked for me. Perhaps my situation is different. Now i had…
Muzaaya Joshua
  • 7,736
  • 3
  • 47
  • 86
12
votes
1 answer

Debugging a CLR hang

I've uploaded a log of a WinDBG session that I'll refer to: https://pastebin.com/TvYD9500 So, I'm debugging a hang that has been reported by a customer. The reproducer is a small C# program: using System; using System.Data.Odbc; using…
Bwmat
  • 4,314
  • 3
  • 27
  • 42
12
votes
2 answers

How to refresh linked tables in an Access mdb when ODBC changes

I can create an Access mdb and add a linked table to an Sql Server database via ODBC. If I change the Sql Server that the ODBC is connecting to with the ODBC control panel applet the mdb still connects to the original Sql Server until Access is…
BTB
  • 2,126
  • 3
  • 21
  • 22
12
votes
1 answer

[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source

I know this question is asked many times and I have tried all but nothing worked. I am trying to connect to a MSSQL database on a different server from Ubuntu 14.04. Content from /etc/odbcinst.in [ODBC] Trace = No TraceFile = /tmp/odbc.log …
Awais Qarni
  • 17,492
  • 24
  • 75
  • 137
12
votes
2 answers

How to create sql alchemy connection for pandas read_sql with sqlalchemy+pyodbc and multiple databases in MS SQL Server?

I am trying to use 'pandas.read_sql_query' to copy data from MS SQL Server into a pandas DataFrame. I need to do multiple joins in my SQL query. The tables being joined are on the same server but in different databases. The query I am passing to…
Sergey Zakharov
  • 1,493
  • 3
  • 21
  • 40
12
votes
1 answer

How do I install PHP PDO ODBC drivers on CentOS 7?

I already have PHP 5.4 installed in a CentOS 7 VPS. I am trying now to access a legacy database in .mdb format with a PHP script. However, my phpinfo() page says that only mysql and sqlite PDO drivers are enabled. No driver named ODBC is…
MiniGunnR
  • 5,590
  • 8
  • 42
  • 66
12
votes
3 answers

odbc_connect() on CentOS 6

I am currently having issues getting odbc_connect to work on my CentOS server. I have installed the Easysoft ODBC-SQL-Server driver with the aim to connect to a Microsoft SQL Server 2012. I am getting the error: PHP Fatal error: Call to undefined…
DevWithZachary
  • 3,545
  • 11
  • 49
  • 101
12
votes
4 answers

java.sql.SQLException: No database selected - why?

the last days I was trying to learn how to access mySQL databases via Java. I am able to load the driver and get a connection to the database ( at least I think so, since I don't get an exception there..) the code is: import java.sql.*; …
sepphuber3
  • 135
  • 1
  • 1
  • 8