Link to home
Start Free TrialLog in
Avatar of rmk
rmk

asked on

Common Dialogs

Chapter 19 of the Access 97 Developer's Handbook (by Litwin, Getz, and Gilbert) provides a very useful function called adhOfficeGetFileName along with a demostration form called frmOfficeFileOpen in ch19.mdb. There is one very desirable feature that I just can't seem to get to work. No matter what I do, adhcGfniNoChangeDir doesn't seem to have any effect one way or the other.

If my current directory is c:\abc and I call adhcOfficeGetFileName, I start looking in c:\abc as I expected. If I use adhOfficeGetFileName to "open" a file in c:\def, I want the next call to adhOfficeGetFileName to start looking in c:\def, and not stay in c:\abc. How can I get this function to "remember" the last directory used?

I also noticed that when I open ch19.mdb I get a message "This database is read only ..." How can I set one of my databases to be read only?

Thanks
Avatar of Trygve
Trygve

This could be solved by using a global variable. If you like you could send me an extract of your database including the functions, forms, tables etc. involved and I will be glad to have a look at it. EMail: kontry@statoil.no

For your last question; There are several ways of doing this. For the ch19.mdb my guess is that this database has been copied from a CD onto your harddisk. All CD files are read only and will stay this way untill you change it. Locate your mdb file using the explorer and right click on it. Select properies and mark the Read-only attribute. Your users will of course be able to do the same trick in reverse, so if you want to secure your database in a more bulletproof manner you should have a look at the security wizard. I can also send you 3 files on Access security if you want, just provide me with your email address.
1. There's a way to know the current directory in any drive. This is

  CurDir [Drive]

This give you the current dir.

2. The second way is to see that Trygve say (the properties of the file)

I hope this help you

guillems: The problem is probably that locating files using these special functions does not change the current directory. It remaing c:\abc. An I must once again say that you are pushing it adding so little new information and calling it an answer. grrr.
Excuse moi! Trygve! I just try to help. I don't think I doing anything wrong. I'm free to do that I want. So Please I think that you must say  pardon!

Have a nice day!

rmk: I have tried to locate ch19.mdb on the net to examine it, but i can't find a copy. My offer to look at your application still stands.

guillems: If you got offended by my comment, then I appologize.
You have to admit though, that a five line answer to a 500 points questions seems a bit to easy. Especially when half the answer is a repetition of my comment.

Of course, you are free to do what you want, but this goes both ways. If you really feal that your answer qualifies as an answer, then please let me know, so I can adjust my personal opinion of what it takes to lock a question.

Have a pleasant day at E-E
Trygve
Sometimes the solution is simple, There's no problem with this. Just there are people who don't see the easy and beaty of the simple things.

Have a nice Day!
Avatar of rmk

ASKER

I guess I was mistakenly under the impression that all serious Access developer's were familiar with the "Access 97 Developer's Handbook". I would really appreciate some input from anywone who has used adhOfficeGetFileName.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Trygve
Trygve

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rmk

ASKER

Thanks for your response.
Hey rmk. Thanks for accepting my answer !

You should have a look at your customer information. It seems to me that you have posted an answer as your personal details.

Have a nice day !
Trygve