Solved

.MDA File Verification for Access 2.0

Posted on 1998-09-14
4
337 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 60 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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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 …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

752 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