dcsimg
July 20, 2018
Hot Topics:

Visual Basic Database Tutorial - Part 4

  • November 19, 2002
  • By Karl Moore
  • Send Email »
  • More Articles »

Previously, weve accessed databases solely through the Data control. But this time were doing it in code, using objects.

Just as you "Dim XYZ as String", were going to do the same with a collection of special objects that allow us to play with our database. For example, you might write "Dim XYZ as Recordset" - which is an object that holds a set of records - then later say "XYZ.Delete", to delete one particular record.

I remember back in the golden olden days of my programming life, when I first saw database access code. Argh! I mean, whod want to write all that code when you have the Data controls?

After a bit of use, it becomes clear that those Data controls arent particularly cool. After all, you often want just one little bit of information from the database - and then youre finished with it. Without code, youll have a clunky Data control constantly loitering on one of your forms. With code, you can simply tell Visual Basic, "access the database, get me that information, close the database"... the end.

In brief, accessing databases via code is amazingly flexible. Oh, and its something else to brag about at the next Visual Basic group meeting.





Page 3 of 8



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

Thanks for your registration, follow us on our social networks to keep up-to-date