Solved

.MDA File Verification for Access 2.0

Posted on 1998-09-14
4
326 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 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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now