Results 1 to 6 of 6

Thread: Renaming an Access file

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2005
    Posts
    24

    Renaming an Access file

    We have a program that is not ours that is writing to a file called "Connect:. We would like to use this file in a VB Application but keep getting an error because "Connetc" is a keyword. Is there anyway to use this file by renaming it in the VB app. we cannot change the file name because the other program is looking for that file to write the data to and we cannot change that.

    Thanks in advance for your help.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Renaming an Access file

    VB Code:
    1. Private Sub Command1_Click()
    2. FileCopy "c:\ConnectC.mdb", "C:\newfolder\newfilename.mdb"
    3. End Sub

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Renaming an Access file

    That changes it for the other program too Hack. (edit: oops, no it doesn't - but it does mean that you aren't working with the same file anymore!)


    There is no way of renaming the file without renaming it for all programs... but what it is called should not be an issue for your program.

    What code/connection method are you currently using?

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Renaming an Access file

    He would be working with the exact same file up until the time it was copied. Anything done to the orignial file after the copy would not be carried over to the new file unless the new file was deleted, and then recopied.

    But, that should be pretty self-evident.

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Renaming an Access file

    Agreed.. it just seems to me that the problem is that there is a coding error which is stopping the file from being opened at all. I also think that there is a need to open the same file that the other app is writing to.

    We'll have to wait for a reply before we know if that is the case tho!

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Renaming an Access file

    Quote Originally Posted by si_the_geek
    We'll have to wait for a reply before we know if that is the case tho!
    Yep, agreed.

    My impression from the original question was that he wanted to use a database in a VB app he is building that is a part of a canned (probably purchased) application. His application being different from the original.

    I've done similar things in the past where my customers wanted reports that the original software package wasn't able to produce, so I sort of "borrowed" the database for my own purposes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width