[AccessD] How to Rename a flat file with Access VBA - For EDIproject

Jim Dettman jimdettman at verizon.net
Sat Jun 25 11:45:37 CDT 2011


Brad,

  Basically what you'll discover is that even though there are EDI
standards, nothing is really standard<g>.

  Each trading partner does things a bit differently then everyone else and
often use the standards in ways that were never intended to be used.  This
impacts your application files and import/export logic into your backend
systems.  That's where the fun comes in<g>

  One example is a N9/MSG loop that exists in many doc types.  The spec was
written so that a N9 segment would represent the subject and the MSG loop
inside it the body.  Yet you will find many partners do:

N9:   Line 1 of message
N9:   Line 2 of message
N9:   Line 3 of message

Instead of
N9:  Message subject
MSG:  Line 1 of message
MSG:  Line 2 of message
MSG:  Line 3 of message

  which is what the spec intended.  

  This is not really the place to discuss EDI however, so if you ever have a
question on anything, just drop me a line.  I've been working with EDI in
the consumer products distribution area for the past six years with partners
like Wal-mart, Amazon, BJ's, Costco, Office Max, Staples, etc, so I know
most of the in's and out's there (not sure what business your in).

  Only other piece of advice right off is if your not using AS2 already for
communications, start looking in that direction.  Most of the industry is
heading that way.  Amazon for example will do nothing but AS2 (they will do
FTP in rare cases, but they really want AS2).

Jim.



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Friday, June 24, 2011 05:38 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] How to Rename a flat file with Access VBA - For
EDIproject

Jim,

We started sending invoices (via EDI) to 1 firm last week.
So far, things have worked Okay.

Any advice on things to watch out for?

Thanks,
Brad  

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman
Sent: Friday, June 24, 2011 9:19 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] How to Rename a flat file with Access VBA

Brad,

  Wait till you get into the EDI; it's a lot of fun ;) 

Jim.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Friday, June 24, 2011 10:07 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] How to Rename a flat file with Access VBA

Thanks for the help, I really appreciate it.

Looks pretty easy (now that I have a sample to start with  :-)

Brad


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of William
Benson (VBACreations.Com)
Sent: Friday, June 24, 2011 8:37 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] How to Rename a flat file with Access VBA

Typo, sorry. BTW Gary's way is much shorter, but if you read up on
FileSystemObject you will see a lot of neat things you can do with it:  

Dim FSO as Object
Set FSO = CreateObject("Scripting.FileSystemObject")
Dim Fil as Obj

Set Fil =FSO.GetFile( yourpath )

Fil.Name = Replace$(Fil.Name,".tbl",".txt")


Also, if you use early binding and set a reference in your project to
Microsoft Scripting Runtime (which every Windows PC will have) - there
are a
lot of other file and folder properties you can mess with and
intellisense
will guide you:


Dim FSO as FileSystemObject
Set FSO = New FileSystemObject 

Dim Fil as File

Set Fil =FSO.GetFile( yourpath )

Fil.Name = Replace$(Fil.Name,".tbl",".txt")



-----Original Message-----
From: William Benson (VBACreations.Com) [mailto:vbacreations at gmail.com] 
Sent: Friday, June 24, 2011 9:27 AM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] How to Rename a flat file with Access VBA

Dim FSO as Object
Set FSO = CreateObject("Scripting.FilsSystemObject")
Dim Fil as Obj

Set Fil =FSO.GetFile( yourpath )

Fil.Name = Replace$(Fil.Name,".tbl",".txt") 



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Friday, June 24, 2011 8:45 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] How to Rename a flat file with Access VBA

All,

We just installed some EDI software that creates a number of flat files.

There is one file that is a text file but the extension is .tbl

I would like to link to this file with Access 2007, but I am running
into
problems because of the .tbl extension.

For the short term, I am simply renaming the file outside of Access.
This works, but I would prefer to do the renaming inside of Access.

Is there a way to use VBA to rename flat files.

Example -
Old name = C:\EDI\Outbound.tbl
New name = C:\EDI\Outbound.txt

I figure that this is pretty easy to do, but I have never done it and I
have
not found an example of how to do it.

Thanks in advance for your assistance.

Brad      

--
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

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-- 
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

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-- 
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