Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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(),":","-"),"/","-")
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page