|
-
Jul 26th, 1999, 02:47 AM
#1
Thread Starter
New Member
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
-
Jul 26th, 1999, 05:34 PM
#2
Member
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.
-
Jul 26th, 1999, 05:35 PM
#3
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|