Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

.MDA File Verification for Access 2.0

Posted on 1998-09-14
4
Medium Priority
?
343 Views
Last Modified: 2013-12-05
I would like a function to check the user's .MDA file uopn entry of my database on a network server. I want them to use an MDA file located on the server to enter the file. I tried this:

function IsItTheCorrectMDA()
if syscmd(SYSCMD_INIFILE)<>"K:\Temp\unique.mda" then
msgbox "Sorry you entererd using the wrong MDA.Application terminates.."
docmd quit
end if
end function

but it doesn't work. Even when I use the correct MDA file I get the message that I am not using the correct one. Any ideas?
0
Comment
Question by:sanctified
  • 2
  • 2
4 Comments
 
LVL 1

Expert Comment

by:st
ID: 1962201
SysCmd(acSysCmdIniFile) is just for determine the Access INI file name.

However, you can use the coding like this:

If Dir("K:\Temp\unique.LDB") = "" Then
     msgbox "You're running wrong MDA"
else
      msgbox "LDB was found, you're running correct MDA"
end if
0
 

Author Comment

by:sanctified
ID: 1962202
ST,

Almost, it doesn't quite work. I can use any MDA that I want to and it will still say "LDB was found, you're running correct MDA" Try again...
0
 
LVL 1

Accepted Solution

by:
st earned 240 total points
ID: 1962203
It is because Access version before 7.0 won't remove the LDB file automatically. However, here is a answer work for all version:

Dim Db As Database
Set Db = CurrentDB()

IF  Db.Name = "K:\Temp\unique.MDA" then
     Msgbox "You're running correct MDA"
else
     Msgbox "You're running wrong MDA"
end if



More points?? :)
0
 

Author Comment

by:sanctified
ID: 1962204
E for effort!!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question