October 24, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

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.

 

 


Sitemap | Contact Us

Rocket Fuel