Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2011
    Posts
    1

    Unanswered: update file path

    In my database I have list of media paths i need to update
    but only want to update the drive all file name need to stay the same

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,482
    Provided Answers: 11
    The way

    open the Table and do a find replace find C: replace with D:

    or write some code

    Dim Rst As Recordset, db As Database
    Dim Temp As String
    Dim NewTemp as String
    Set db = CurrentDb
    'Make the SQL test it first is what you want to see
    SQL = "SELECT * FROM TableName WHERE ((Tablename.Media) Like 'C:*'));"

    Set Rst = db.OpenRecordset(SQL)

    Do Until Rst.EOF
    Rst.Edit
    Temp = Rst("Media")
    Newtemp = replace(Temp,"C:","D:")
    Rst("Media") = NewTemp
    Rst.Update
    Rst.MoveNext
    Loop
    Rst.Close
    Set Rst = Nothing

    before runing D O B A C K U P F I R S T just in case
    hope this help

    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.
    DONT WORRY ABOUT THOSE WHO TALK BEHIND YOUR BACK
    THEY'RE BEHIND YOU FOR A REASON

Posting Permissions

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