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
Solved

.MDA File Verification for Access 2.0

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exporting from Access 2016 to a CSV file 4 47
trim dropdown value before executing query 8 26
Problem with vba code 4 39
Access VBA to Count Worksheets in a Workbook 3 21
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

856 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