Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Posts
    9

    Unanswered: DAO Method of accessing Database, HELP requested

    Dear,

    I want to write a few codes as part of event procedure in access using DAO method.

    Dim myws As Workspace
    Dim mydb As Database
    Dim mytran As Recordset
    Set myws = DBEngine.Workspaces(0)
    Set mydb = myws.Databases(0)
    Set mytran = mydb.OpenRecordset("Dummy", DB_OPEN_DYNASET)

    However, the result has been a miserable failure. Could you please suggest an easier method and show how to store the values in fields.

    Thanks

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    consider:

    dim dabs as dao.database
    dim recs as dao.recordset
    set dabs = currentdb
    set recs = dabs.opendatabase("Dummy")

    aDeclaredVariableOfSuitableType = recs!nameOfAnyFieldInYourRecordset

    ...it's enough.

    izy
    currently using SS 2008R2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •