1 / 14

Microsoft Access

Microsoft Access. Using Visual Basic Routines. Visual Basic Datatypes. Boolean Byte Currency Date Double Integer Long Object Single String Variant Hyperlink. Variables and Arrays. Use of “Dim” e.g. Dim count as Integer Use of “Dim” to create arrays

hamish
Télécharger la présentation

Microsoft Access

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Microsoft Access Using Visual Basic Routines

  2. Visual Basic Datatypes • Boolean • Byte • Currency • Date • Double • Integer • Long • Object • Single • String • Variant • Hyperlink

  3. Variables and Arrays • Use of “Dim” • e.g. Dim count as Integer • Use of “Dim” to create arrays • e.g. Dim intArray(1 To 10) as Integer

  4. Initializations • intVariable = 10 • stringVariable = “Hello, world.” • dateVariable = #02/02/2001#

  5. Variable Scope and Lifetime • PUBLIC: seen by all the procedures in that module • PRIVATE: can be referenced from within the module in which it is declared

  6. Selection Structures If <expression> Then statement1 statement2 Else statement3 statement4 End If

  7. Selection Structures Select Case <integer variable> Case <value 1> statements… Case <value 2> statements… Case Else statements... End Select

  8. Loops For <variable> = <start> To <end> statement 1 ... statement2 ... Next

  9. Loops (contd…) Do Until <condition> statement 1 ... statement 2 ... Loop

  10. Procedures <access modifier> Sub <procname>(<parameters>) … Code for the procedure … End Sub

  11. Data Objects • DAO = Data Access Object • RDO = Remote Data Object • RDS = Remote Data Services • ADO = ActiveX Data Object

  12. Useful DAOs • DAO = Data Access Object • Database • RecordSet

  13. Database DAO • Refers to the database open in the current workspace. Only one database per workspace. • E.g. • Dim db as Database • Set db = CurrentDb

  14. Recordset DAO • There exists one Recordset object for every recordset currently open. • A Recordset is the result of the execution of a query. • E.g. Dim rs as Recordset • Set rs = db.OpenRecordSet(“Login”)

More Related