[AccessD] DIR Command Failing-but not everywhere...

Heenan, Lambert Lambert.Heenan at AIG.com
Mon Oct 3 11:10:39 CDT 2005


Ah Hah! That's the one case (?) where Dir() does not just return an empty
string. Nice catch.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Steve Conklin
Sent: Monday, October 03, 2005 11:08 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] DIR Command Failing-but not everywhere...


That error happens when an existing drive (like a CD Rom ) is emtpy;
not-ever-existed drive just returns empty string to DIR.  Are you sure you
didn't get new letters assigned from the re-format?  Or plugged in a
multi-card reader (SD, CF,etc) that changed/added letters?

Steve
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin -
Beach Access Software
Sent: Monday, October 03, 2005 10:49 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] DIR Command Failing-but not everywhere...

Greg:

If you have no G: drive at home, wouldn't you expect the Dir command to fail
on second one where it's looking for a G drive?

Rocky

----- Original Message -----
From: "Greg Smith" <GregSmith at starband.net>
To: <accessd at databaseadvisors.com>
Sent: Monday, October 03, 2005 7:25 AM
Subject: [AccessD] DIR Command Failing-but not everywhere...


> Hi everyone!  Hope you all are having a GREAT day!
>
> I've got a real puzzle here.  I'm using the Dir() command (Access 2003
> module) to find if a filename exists in a specific directory, or not.  
> The exact syntax is shown below.  The code is checking for a specific 
> file in two different directories (one exists at work, and one at the 
> customer's), and if it can't find that file in either location, the 
> application warns the user that it's not available right now and 
> closes automatically.
>
> The code is:
>
>    strFileName = Dir("c:\MyData\chkfile.ozx")
>    strFileNameBHC = Dir("G:\BHCRecorder\Scripts\chkfile.ozx")
>    If strFileName <> "chkfile.ozx" And strFileNameBHC <> "chkfile.ozx" 
> ...
>
> This code works perfectly at work and at the customer's.  So, you may 
> ask, what's the big deal?  Well, I also work on this at home, and I 
> just (within the last 3 weeks) reformatted my home computer (winXP), 
> reinstalled everything (supposedly...), and service packed everything 
> up to date.
>
> When I run this application at home, it fails on the Dir() command 
> where the directory doesn't exist.  Since I'm at home, for example, I 
> don't have a "G" drive and it fails on that one with the message "Bad 
> Filename or Number", and the error number is 52.
>
> The application is identical in both places...that is, I take a copy 
> home and put it on my computer, relink all the tables to the BE and 
> everything else is the same.
>
> Either I've not installed something correctly at home, or I've not 
> installed something I need to have.  Or both.  The references are all 
> the same and none are missing at either location.
>
> Anyone else see this before?
>
> TIA!!
>
> Greg Smith
>
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list