Solved

.MDA File Verification for Access 2.0

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

Independent Software Vendors: 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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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.

631 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