Re: Dir Function

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You have raised an interesting point I had not even considered about
"Program Files" folder in the program installation and the API call. Would
you be able to direct me to the API syntax that would check for the program
installation?

Thanks

"Wayne Morgan" <comprev_gothroughthenewsgroup@xxxxxxxxxxx> wrote in message
news:u7DjLJFRGHA.1728@xxxxxxxxxxxxxxxxxxxxxxx
While you can do what you have, the <> should be = and "Program Files" is
missing from the Dir(). Also, I would actually recommend verifying that
the
file exists at all, not just assume that because the mdb file isn't there
that the mde is.

strFileName = Dir("C:\Program Files\Customer Info\customer.MD?")
If strFileName <> "" Then
Set dbsCustomer = OpenDatabase("C:\Program Files\Customer Info\" &
strFileName)
End If

Also, are you installing in "C:\Program Files" or are you installing in
the
defined Program Files folder (i.e. Windows wasn't installed on the C:
drive). If the latter, you would need to do an API call to get the defined
folder. You could also check for the "ProgramFiles" environment variable.
The API call is preferable.

--
Wayne Morgan
MS Access MVP


"box2003" <spambox03@xxxxxxxxx> wrote in message
news:Ox7$waERGHA.1160@xxxxxxxxxxxxxxxxxxxxxxx
I created a database in .mdb format and want to distribute locally in
..mde
format. Part of my code below checks for either the .mde or .mdb format
and
opens the database accordingly. Is this a correct method or is there a
better way. The purpose is to allow me to test and develop this
application
in .mdb format and then create the .mde format and still have the
application run in either formats.

If Dir("C:\Customer Info\customer.MDB") <> "" Then
Set dbsCustomer = OpenDatabase("C:\Program Files\Customer
Info\Customer.mde")
else
Set dbsCustomer = OpenDatabase("C:\Program Files\Customer
Info\Customer.mdb")
End If







.



Relevant Pages

  • Re: New Version (Major Update) of SysInternals Process Explorer
    ... It then Reads the Registry using the standard windoze API ... "Data mismatch between Windows API & Raw Hive Data" ... That "URL Protocol" Entry is a String Value ... It's in there as part of the Medion Factory Installation Image - ...
    (uk.people.silversurfers)
  • Re: Persistent Process Kill
    ... "BlockInput" could do what you want. ... Here is a demo script: ... ' test "sleep" api call, using DynaWrap, ca 2000, jw ... That would prevent msiexec from being able to write the installation ...
    (microsoft.public.scripting.vbscript)
  • Re: Messgeraete-Steuerung ueber Excel etc?
    ... Dafür gibt es API und DLLs, ... sondern einfach nur einen Excel File laufen laesst. ... Installation uns so. ... braucht man dann noch die Runtime :-( ...
    (de.sci.electronics)
  • Re: SetupCopyOEMInf is prompting when no digital signature available
    ... The reason why I wanted to do it with the API is that I am currently copying ... > There is nothing wrong with the security prompt as long as it comes only ... > upon installation but here I am just copying the INF and am not insatlling ...
    (microsoft.public.development.device.drivers)
  • RE: Deployment for non-admin use - best practices
    ... permissions to Program Files is probably not a good idea... ... You wouldn't set permissions on the Program Files folder, ... Use the API call to get the folder location. ...
    (microsoft.public.access.modulesdaovba)