Solved

How to Connect to Database with ODBC and whats the diffrence

Posted on 2007-11-23
3
292 Views
Last Modified: 2010-04-23
Hello guys,
                   whats the diffrence between ODBC and ADO.net, which are better, and is there any sample code of ODBC for vb.net 2005 (insert, delete,update, and select) .
Best regards
0
Comment
Question by:saudiprogrammer
  • 2
3 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20341853
ODBC is older and slower than ADO.net, but first allow you to connect to lots of database engines because it is independent of programming languages, database systems, and operating systems. ADO.net has ben specifically designed for the .net framework.

For an example of ODBC with vb.net, have a look to:
http://support.microsoft.com/kb/310985
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
ID: 20341854
0
 
LVL 14

Expert Comment

by:cuziyq
ID: 20341877
ODBC is an open set of standards that allow access to many different kinds of data sources (including databases like Oracle and MS SQL Server, file-based databases like Access or dBase, or even Excel and XML files).  Any data source that has an ODBC driver can be accessed using the same set of APIs with minimal rewriting of code.  Another advantage to ODBC is that it is available on all platforms (UNIX, Mac, and others), not just Windows.  A module written in C++ using the ODBC API can be ported very easily between platforms.

A major drawback to ODBC is that many custom features of database systems such as Oracle or MS SQL Server are not implemented in the ODBC API because they are specific to that company's product (although for a beginner, this will not be an issue).

ADO.NET is a Microsoft proprietary technology that is primarily used to interact with (obviously) other Microsoft products -- especially MS SQL Server.  ADO.NET's advantage is that modules written in .NET can be used in any of the .NET languages, and ADO.NET based database modules can be recompiled and implemented without having to register DLLs or reboot the web server.  .NET also makes heavy use of DCOM, which allows programs to communicate with each other.  Basically, that means that companies that make financial software, for example, can have their web site use the same database as their desktop product, or their inventory product.

The drawback to ADO is of course that it is proprietary M$ software.  It only works on Windows, and if Microsoft ever decides to deprecate it, you're out of luck.  This has happened before with their technologies such as OLE DB and MDAC (which were former database access technologies given up in favor of ADO).  The official M$ position is that new programs should not be written in OLE DB.  Microsoft will continue to support it (for a while, at least), but no new features will be added.  If you wrote your program with OLE DB tools, you're basically stuck rewriting your software if you want it to continue to be used in the future.

So basically your choices are an open standard but with a little more work to use some of the features, or a totally proprietary system, but with more flexibility and faster coding time.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now