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.
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:
Re-scan downloaded files using your personal virus checker before using it.
NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
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...
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.
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.
You may link to this article from another website, but ONLY if it is not wrapped in a frame.
You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
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.)
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.)
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.)
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.)
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.)
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.)
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.)
I have been searching for days for such an example. EXCELLENT WORK! Perfectly commented! THANK YOU!! (If this comment was disrespectful, please report it.)
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.)
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.)
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.)
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.)
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.)
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.)