Page 1 of 1 1
Topic Options
#145233 - 2005-08-10 07:05 PM General ODBC Question
thepip3r Offline
Hey THIS is FUN
*****

Registered: 2005-03-02
Posts: 350
Can you use ODBC to connect to any database? --Like can I use ODBC to connect to and write to MySQL, SQL, Oracle databases without using a specific driver?? Is that the purpose of ODBC? I guess I just don't totally understand ODBC and was wondering if anyone had any good links to read up on for the subject. Thank you in advance.
Top
#145234 - 2005-08-10 07:53 PM Re: General ODBC Question
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
ODBC is more of a standard. You will need specific ODBC drivers for each database. I suggest you visit the Microsoft web site and search for ODBC and MDAC for more information.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#145235 - 2005-08-11 06:05 AM Re: General ODBC Question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
ODBC drivers are also supplied by the respective database vendors, e.g. if you need to connect to Oracle.
_________________________
There are two types of vessels, submarines and targets.

Top
#145236 - 2005-08-11 07:35 AM Re: General ODBC Question
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Quote:

Can you use ODBC to connect to any database? --Like can I use ODBC to connect to and write to MySQL, SQL, Oracle databases without using a specific driver??




There are a number of articles on DSN-Less Connections, if you do a Google Search. However, they still use a driver (DLL File) to make the connection. Think of it this way, when you go up to meet someone for the first time.. What do you do? You give them a handshake. Think of an ODBC driver/connection as the handshake. If there is no handshake, there is no connection. Like Howard and Jens said, you will need to connect in. There are drivers can come from Microsoft for Oracle, but generally are better from Oracle themself. MySQL had their own driver and Microsoft does not have a MySQL Drivere.

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#145237 - 2005-08-11 10:16 AM Re: General ODBC Question
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
The answers are all in the above posts, but I'll take your questions one at a time to clarify a bit.

Quote:

Can you use ODBC to connect to any database? --Like can I use ODBC to connect to and write to MySQL, SQL, Oracle databases without using a specific driver??



No.

For each database that you connect to you will need to install a specific driver that knows how to tak to the database.

A database service does not "talk" ODBC, it will only talk it's own (often proprietary) language.

Quote:

Is that the purpose of ODBC?



No.

ODBC is an abstraction. It allows you to write code that uses ODBC SQL. This SQL is independant of the back-end database that you are using. It means that in most cases you can take the same code and use it with any back-end database without changing it. All you need to do is change the DSN or the connection string.

Each ODBC database driver will convert the ODBC commands into something that the back-end database understands, but this happens behind the scene, you don't ever need to worry about it.

So, if you connect to an Oracle database your Oracle driver will convert the ODBC commands into Oracle SQL or SQL*Net or PLSQL whatever it is nowdays.

The drivers will also emulate some things that are not supported in the back end but are part of the ODBC standards.

The only tricky bit is that there are different versions of ODBC which support different features, so don't always expect to be able to use advanced techniques such as cursors - you need to code to the lowest featured ODBC driver that you reasonably expect to encounter.

Quote:

I just don't totally understand ODBC and was wondering if anyone had any good links to read up on for the subject




With any term like this a good place to start is Webopedia http://www.webopedia.com/TERM/O/ODBC.html

You could also google for "ODBC FAQ" and see what turns up.

Top
#145238 - 2005-08-11 05:03 PM Re: General ODBC Question
thepip3r Offline
Hey THIS is FUN
*****

Registered: 2005-03-02
Posts: 350
Thanks gents. That answered all of my questions and then some. I appreciate the posts and links. I was just hoping there would be a universal "driver" to write to databases and wasn't sure exactly what ODBC was. Now I do and know that ODBC does not provide that for me.
Top
#145239 - 2005-08-14 02:29 PM Re: General ODBC Question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
That "universal driver" is called, SQL, or more specifically SQL-92. ODBC is just the means to establish a connection to a database and lays the groundwork to interact with it. ODBC is like TCP/IP, just a means to connect. The interaction with a database itself is handled via SQL, either proprietary SQL codes that only work with a subset of databases, or the standard set as specified in the SQL-92 standard.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 363 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.094 seconds in which 0.065 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org