Airfield Models - Visual Basic Database

Converting VB DB to a Daily Quote Applet (Developer's Version) - Step 3

May 05, 2015



Home
About
Site Feedback
Register
Contact
Site Map
Add to Favorites
Tell a Friend
Comments
Items For Sale
Search Airfield Models

Back to VB DB

 

Airfield Models (http://www.airfieldmodels.com/)Converting VB DB to a Daily Quote Applet
(Developer's Version)

Download VB DB Source Code here.

 
 

Step 3 of 7

In the bVBDB.bas module, change the names of the fields in the FIELD_INDEX Enum to the names of fields for your table.

Before conversion

' bVBDB.bas

Option Explicit

Public Enum FIELD_INDEX

  ' ****** Do Not Modify! ******
 
RECORD_ID = 0
  DATE_CREATED = 1
  LAST_MODIFIED = 2
  FIELD_INDEX_MIN = LAST_MODIFIED + 1
  ' ****** End Do Not Modify ******

  ' ***** MODIFY *****

  ' Create an index for each field in your table.

  ' Use descriptive Index names such as UserName, Password, etc.
  ' VB DB doesn't care what the names are, but you will.

  ' The first field entered here should always equal FIELD_INDEX_MIN
 
FIELD_01 = FIELD_INDEX_MIN
  FIELD_02
  FIELD_03
  FIELD_04
  FIELD_05
  FIELD_06
  FIELD_07
  FIELD_08

  ' FIELD_INDEX_MAX should always equal the last Enum entry
 
FIELD_INDEX_MAX = FIELD_08

  ' ***** END MODIFY *****

End Enum

For this example we delete all the Field_XX fields and add two new fields; QUOTE_TEXT and QUOTE_AUTHOR.

Note:  Change the last Enum entry (FIELD_INDEX_MAX) to equal the LAST field in the FIELD_INDEX Enum.  This suggestion from Martin Liss is gratefully acknowledged as it prevents having to modify several lines of code.

After conversion

' bVBDB.bas

Option Explicit

Public Enum FIELD_INDEX

  ' ****** Do Not Modify! ******
  RECORD_ID = 0
  DATE_CREATED = 1
  LAST_MODIFIED = 2
  FIELD_INDEX_MIN = LAST_MODIFIED + 1

  ' ****** End Do Not Modify ******

  ' Modified Fields
  QUOTE_TEXT = FIELD_INDEX_MIN
  QUOTE_AUTHOR

  ' FIELD_INDEX_MAX should always equal the last Enum entry
 
FIELD_INDEX_MAX = QUOTE_AUTHOR

End Enum

 
 

Previous
Next

Step 2 of Converting VB DB to a Daily Quote Applet (Developer's Version)
Step 4 of Converting VB DB to a Daily Quote Applet (Developer's Version)

Comments about VBDB

 
 

Back to VB DB
Airfield Models Home

 
 

Copyright 2002-2005 Paul K. Johnson