Important alert: (current site time 7/16/2013 12:31:43 AM EDT)
 

article

ADO Tutorial For Absolute Beginners

Email
Submitted on: 10/14/2000 8:31:59 AM
By: Jerry Barnes  
Level: Beginner
User Rating: By 64 Users
Compatibility: VB 6.0
Views: 153457
 
     This is an ADO DB tutorial for programmers who know nothing about ADO. It is a good template to following when making your own project. I hope that it helps.
 
winzip iconDownload article

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this article, you agree to the following terms...   
  1. You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

11/6/2000 6:28:12 PMJohn Weldon

I was very surprised to find the code easy to read. The proper naming conventions were used throughout the code which made it user friendly. Thanks for your explanation and demonstration of ADO programming!
(If this comment was disrespectful, please report it.)

 
11/14/2000 11:35:34 AMAndrew McManus

When you add a new record, instead of closing and opening the recordset again, you can use rsRecordSet.Requery.
(If this comment was disrespectful, please report it.)

 
11/14/2000 2:22:26 PMJerry Barnes

Good point. I wrote this tutorial to get a better understanding of ADO. At the time, I thought it was easier to open and close the recordset. I may do an update when some changes such as yours (and use an HTML presentation like my Class Module Tutorial). Thanks for your input.

Thanks
(If this comment was disrespectful, please report it.)

 
12/6/2000 3:15:21 PMCRUZANA

Hey the code is very useful and cool!!
it's a major InPuT!!!
(If this comment was disrespectful, please report it.)

 
12/7/2000 8:41:20 PMPissedoff

You guys will probably laugh at this, but how do I get rid of this invalid key problem? I am using vb5, and none of the code I get from this site works.
(If this comment was disrespectful, please report it.)

 
1/20/2001 2:51:38 PMPhilip

No other words.......Excellent
(If this comment was disrespectful, please report it.)

 
3/29/2001 12:16:31 AMsanjay

i tried this example and it works excellent
(If this comment was disrespectful, please report it.)

 
4/6/2001 11:50:48 AMwacook

I have an error when using a modified version of the ADOTutorial you wrote. Your code was very helpful.
(If this comment was disrespectful, please report it.)

 
7/14/2001 2:25:01 PMGeno

This is well commented and extremely helpful for string writing.
Thanks
(If this comment was disrespectful, please report it.)

 
7/16/2001 5:37:56 PMRob

Finally someone out there that understands that there are those of us that are good programmers, just not always in the same language that they are. I was looking for a way to write programs that I have already done in cold fusion, in a stand alone application.
this saved the day for me.
Thanx
(If this comment was disrespectful, please report it.)

 
7/25/2001 8:44:36 AMJohn Russell

Well done. Very clearly presented information which I found very useful.
(If this comment was disrespectful, please report it.)

 
9/1/2001 10:33:39 AMjanilane

Thanks Jerry Barnes, I finally a code that doesn't have an error on ADO introduction, thanks for considering us new programmers by submitting beginner articles that would help us a lot.

thank you again...
(If this comment was disrespectful, please report it.)

 
11/27/2001 3:52:56 AMPaul Pardee

I have been searching for days for such an example. EXCELLENT WORK! Perfectly commented! THANK YOU!!
(If this comment was disrespectful, please report it.)

 
1/5/2002 5:45:58 PMDaveW

Really neat!!
Gets ya cookin early!
Thank you.
(If this comment was disrespectful, please report it.)

 
2/20/2002 10:26:49 AMwayne braun

Thank You! Thank You! Thank You!
This gave me much needed help.
(If this comment was disrespectful, please report it.)

 
3/14/2002 9:20:41 AMwoweee

this is code is awesome men !!!!
(If this comment was disrespectful, please report it.)

 
5/4/2002 6:06:09 PMJames

In response to the VB5 and invalid key question, you need to open the VBP file and remove the line starting with 'Retained = '
(If this comment was disrespectful, please report it.)

 
5/14/2002 9:13:11 AMlai tang

first time i ever commented on a code and this is worth it! man you are a life saver
(If this comment was disrespectful, please report it.)

 
5/21/2002 7:27:26 AMgary

fantastic, got me working
(If this comment was disrespectful, please report it.)

 
6/1/2002 5:47:23 PMHarsh Sabharwal

Hey,
I am going to download your code. But my enquiry is "how to save IMAGE with data". e.g. Address book Printing.
In this we need to save information of person + photograph.
Please guide me.
(If this comment was disrespectful, please report it.)

 
8/23/2002 2:06:44 PMcheong

I have a question and I hope you can offer some insight.
Do you know a simple way to use ADO to connect to a DBF file and store the data from the file in a recordset?

Thank you
(If this comment was disrespectful, please report it.)

 
10/30/2002 4:42:52 AM

I have been trying to use ADO but failed. i hope this will help
(If this comment was disrespectful, please report it.)

 
11/14/2002 10:49:10 AM

EXCELLENT job.. keep it up!
(If this comment was disrespectful, please report it.)

 
1/7/2003 11:27:31 AM

I think the help is excellent!
But I got a runtime error in the line: connRecovery.Open strConnect
The database I'm reading is in access 2000, don't know if that's the problem.
(If this comment was disrespectful, please report it.)

 
7/29/2003 4:16:06 PM

I have now made changes in the program, now work good.
Her your send this change ?
I have not Your e-mail.

(If this comment was disrespectful, please report it.)

 
10/26/2003 1:07:37 PM

thanks you save my day, ur not just good programmer but a verygood programmer with character.
(If this comment was disrespectful, please report it.)

 
1/8/2004 12:13:21 PM

Hi Genius,
This is the best basic example I have seen so far. Good Job.
I'm having a little problem. I'm new to VB, but not really new to ADO. I have used ADO with ASP.
I was trying to follow your example and create my own app, but I got the following error?:

User-defined type not defined
It highlighted the following line:
WithEvents connConnection As ADODB.Connection

Please help!
(If this comment was disrespectful, please report it.)

 
3/24/2004 11:05:02 AM

Thank you! you have saved me..
(If this comment was disrespectful, please report it.)

 
4/18/2004 9:03:52 PM

He was of an explanation, as this that I needed to understand, a
little of the ADO
(If this comment was disrespectful, please report it.)

 
6/15/2004 10:17:24 PM

Great example! Your code was very easy to follow. Can you show me how to replace the call from using MS Access to using IBM iSeries Client Access ODBC? Thank you very much.
(If this comment was disrespectful, please report it.)

 
7/4/2004 11:05:33 PM

NICE !! , im a DAO user, and want to shift in ADO tnx So much! EXCELLENT
(If this comment was disrespectful, please report it.)

 
7/22/2004 4:04:04 PM

Written in the year 2000 and still usefully
ThanX man, I was a DAO user.
(If this comment was disrespectful, please report it.)

 
8/16/2004 4:12:42 AM

your tutorial is very helpful for a beginner like me. I've learned so much in a very short time.
(If this comment was disrespectful, please report it.)

 
9/3/2004 3:53:20 PM

hi , brilliant toutorial, love it, just need like, search features , i stuck on it :( can u help ?
(If this comment was disrespectful, please report it.)

 
11/9/2004 12:28:07 PMEric Harris

First off I voted 5*!!!! I've learned ALOT!!, THANX!!! Most of the examples I've found used the ADODC control, which I'd rather not use (for aesthetic reasons, of course)

Now I saw your note with a problem in cmdSave_Click where you close and reopen the rsRecordSet, due to an issue with immediately deleting a newly added record. I was thinking that using rsRecordSet.Requery would solve your issue, but I first tried to duplicate your issue, by commenting out the close and open statements, but I couldn't replicate your issue. Can you please give me the steps to see your problem, so that I may be able to help? I am intrigued because I used to be in software quality assurance, and like to make software as efficient as possible.

You should print out your code, put a cover on it, call it "ADO For Dummies", and sale it, hehehe. I don't remember the last time that I've seen code so well written, commented, and helpful. THANKS AGAIN!!!!!!!!!
(If this comment was disrespectful, please report it.)

 
12/25/2004 5:39:21 AMSachin Jain

Best Code I have ever seen on earth...
5 from me...
(If this comment was disrespectful, please report it.)

 
7/25/2005 10:22:49 PMJacques Lafontaine

I speak in English just a little bit. I have try the tutorial, but it doesn't works. I have done what I saw, I think my problem is with the recordset. Can someone will help me, I will appreciate it. Thank you for your help.
(If this comment was disrespectful, please report it.)

 
7/28/2006 10:29:10 AMChris

your tutorial for ADO really help me tnx
(If this comment was disrespectful, please report it.)

 
8/20/2007 2:59:50 AMby

thank you for your guide..it helps me a lot.
(If this comment was disrespectful, please report it.)

 
11/28/2007 11:08:46 AM

Good job, very easy to read and understand. I might be using some of the codes here giving credits to the author by mentioning his name at the credits section of my program.
(If this comment was disrespectful, please report it.)

 
7/24/2008 10:49:26 AM

Very lucd but I am hung up by this error.
Run-time error '3265':
Item cannot be found in the collection corresponding to the requested name or ordinal.
Thanks in advance for helping
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.