Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Moving Files and automatically

Discussion in 'Information Technology' started by 60thjeep, Jul 28, 2006.

  1. 60thjeep

    60thjeep
    Expand Collapse
    Guest

    Hi, I am in need of some help with a database I am trying to design.

    I am trying to move a file "1.bmp" from a folder to a different folder,
    automatically rename it, pass the file location back to an "image" table and
    then move the next file "2.bmp" until all files are moved. I need to
    autoname, because I will have to do this over and over starting with "1.bmp"

    Any tips would be helpful.

    Thanks
     
  2. Loading...

    Similar Threads Forum Date
    Islam Moving Mountains Interfaith Dialogues Nov 29, 2012
    World Man punches nurse for removing wife's burqa Breaking News Dec 25, 2011
    SALDEF Stop Arizona From Removing Balbir Singh Sodhi from 9/11 Memorial Sikh Organisations Apr 27, 2011
    Moving Forward, Or Sliding Backward Sikh Sikhi Sikhism Oct 20, 2010
    Moving to Montreal, Canada Need Help! Community Out-Reach Oct 18, 2010

  3. Steve Schapel

    Steve Schapel
    Expand Collapse
    Guest

    60thjeep,

    You haven't given us much to go on, but maybe something along these (air
    code!) lines will help give you a clue...

    Dim FileFrom As String
    Dim FileTo As String
    Dim i As Integer
    i = 1
    FileFrom = Dir("C:\FromPath\*.bmp")
    Do Until Len(FileFrom) = 0
    FileTo = "C:\ToPath\" & i & ".bmp"
    FileCopy FileFrom, FileTo
    CurrentDb.Execute "INSERT INTO Image ( ImagePath ) VALUES ( '" &
    FileTo & "' )"
    Kill FileFrom
    i = i + 1
    FileFrom = Dir("C:\FromPath\*.bmp")
    Loop

    --
    Steve Schapel, Microsoft Access MVP

    60thjeep wrote:
    > Hi, I am in need of some help with a database I am trying to design.
    >
    > I am trying to move a file "1.bmp" from a folder to a different folder,
    > automatically rename it, pass the file location back to an "image" table and
    > then move the next file "2.bmp" until all files are moved. I need to
    > autoname, because I will have to do this over and over starting with "1.bmp"
    >
    > Any tips would be helpful.
    >
    > Thanks
     
  4. gee664@gmail.com

    gee664@gmail.com
    Expand Collapse
    Guest

    for i, you can use a timestamp (but remove the special characters that
    can't be used for a filename)

    for example:

    i = replace(replace(now(),":","-"),"/","-")
     

Share This Page