?
Solved

How to Connect to Database with ODBC and whats the diffrence

Posted on 2007-11-23
3
Medium Priority
?
312 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

719 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