|
-
Jan 9th, 2000, 02:27 PM
#1
Thread Starter
Addicted Member
I have this database app where on its opening, I would like to alert the user if he doesn't have network access to the database...
I have the path of the database in the registry and would like to see on each opening of the app if the user actualy has access to that path...
thanks for your help
-
Jan 9th, 2000, 04:25 PM
#2
Frenzied Member
either trap the error when opening the database or use:
Code:
Public Declare Function GetFileAttributes Lib "kernel32" Alias "GetFileAttributesA" (ByVal lpFileName As String) As Long
this returns -1 if the file doesn't exist
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
-
Jan 9th, 2000, 11:28 PM
#3
You could just as easily use the Dir function to check the files existence and thereby if the user has access, ie.
If Len(Dir("F:\PathToDB\TheDB.Mdb")) = 0 Then Msgbox "No Access To Database"
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Jan 10th, 2000, 01:57 AM
#4
Thread Starter
Addicted Member
Thanks for the help...
I haven't tried the API Call cuz I want to keep it simple but when I use DIR... if I don't have access to the specified path, my app stops responding... I'm using MS-Access 2000...
Any ideas why it does that and how I can correct it?
-
Jan 10th, 2000, 02:16 AM
#5
If you're using a UNC, (Universal Naming Convention), path it may seem to lock up if it can't find the Workstation\Server. If this is the case try using a Logical Drive Path, ie. "F:\Folder\Database.mdb".
I've not been unlucky enough to use Access2000.. Yet.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
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
|