Results 1 to 3 of 3

Thread: Data Control Confusion

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 1999
    Location
    Brooklyn,Ohio USA
    Posts
    2

    Post

    I am just learning Visual Basic and learning on VB 5.0. I am currently trying to create an address book, contact database. All is going well including creation of new .mdb file "address book", I want the user to be able to create a new book whenever they like. Anyway, this all seems to be working fine. THE PROBLEM, I want the application to open remembering the last used address book. I have spent 100.00 on vb programming books and hours on the internet trying to figure this one out. Please Help...
    I know this project is REALLY overdone but I figured it would be a simple enough project to create to learn vb. Any reply's would be appreciated. THANKS

  2. #2
    Member
    Join Date
    Jan 1999
    Location
    Longmont,CO
    Posts
    53

    Post

    In the Form_Unload event you could persist the last used database file name in the registry. Then, in the Form_Load event, your app could check that value and open the database.

    Use the VB function SaveSetting to save the last db file used. Use the GetSetting function to retrieve it on Form_Load.

  3. #3
    Lively Member
    Join Date
    Jan 1999
    Posts
    82

    Post

    Hi,

    You could use GetSetting(appname, section, key[, default]) and SaveSetting appname, section, key, setting functions.

    The SaveSetting saves a value in the Windows registry for the application and GetSetting retrieves this setting.

    Ex:

    SaveSetting app.exename, "DataBase", "LastUsed", "nameofdatabase"

    dbname = GetSetting(app.exename, "Database", "LastUsed")

    HTH,

    Preeti

    ------------------

Posting Permissions

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



Click Here to Expand Forum to Full Width