kipl20 0 Newbie Poster

hi,

i have a database that needs to add a files url to the database field. the thing i first want to do is create a new directory for the file and add the file to the directory, then add the url linking the file to the new dircetory.

i have used an open file dialog and can get the url where this fiel originally comes from, my question is how would i add this to a new directory then get the files new url in the new directory then add theat url to datbase field?

here is some code i have used for an example
(code)

If RadAudio.Checked = True Then
With OFDAddMediaFile

' sets whether multiple files can be opened
.Multiselect = True

'Filters for certain file types to be shown
.Filter = "MP3 Files|*.MP3|All Files|*.*"
.FilterIndex = 1

' sets initial directory on opening of file dialog
.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments()

End With

ElseIf RadOther.Checked = True Then

With OFDAddMediaFile
.Multiselect = True
.Filter = "WMA Files|*.WMA|All Files|*.*"
.FilterIndex = 1
.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments()
End With

ElseIf RadVideo.Checked = True Then

With OFDAddMediaFile
.Multiselect = True
.Filter = "Audio Files|*.AAC*.WMA*.MP3*.WAV|All Files|*.*"
.FilterIndex = 1
.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments()
End With

ElseIf RadImage.Checked = True Then

With OFDAddMediaFile
.Multiselect = True
.Filter = "WAV Files|*.WAV|All Files|*.*"
.FilterIndex = 1
.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments()
End With
End If

' uses the openfile dialog tool to open up the file browser and adds the selected files to the listbox
'also formats to show just filename and not path

If OFDAddMediaFile.ShowDialog() = Windows.Forms.DialogResult.OK Then

Dim fsFiles As String() = OFDAddMediaFile.FileNames
Dim fsFile As String = OFDAddMediaFile.FileName
For i As Integer = 0 To OFDAddMediaFile.FileNames.GetUpperBound(0)
lstFiles.Items.Add(System.IO.Path.GetFileName(OFDAddMediaFile.FileNames(i)))
Next

(code)

any help would be greatly appriecited
thanks in advance

ps the database is an access database and i am using visual studio 2008