I am developing with visual basic 2005 and access 2007.
What I have is an access table that has full pathes to the pdf files located in 1 regular folder on my drive.
So,I have an access table called "files" with "c:\files\main.pdf" pathes.
In run time I have a datagridview on the form that populates the names of these pdf files and excludes the entire path except the name in code. What I need is to be able to grad a pdf file out of this datagridview while maintaining the path to a particular pdf file and grad into another datagridview.
Can someone point me into a right direction.
Private Sub Populate_All(ByVal FileName As String)
FileName = "'%" & FileName & "%'"
Dim Sql As String = "SELECT Files FROM FileCondition"
Dim cmd As New OleDbCommand(Sql, Conn)
Dim da As New OleDbDataAdapter
Dim ds As New DataSet
Dim dt As DataTable
da.SelectCommand = cmd
dt = ds.Tables("Data")
'DataGridView1.AutoGenerateColumns = False
DataGridView1.DataSource = dt
DataGridView1.Columns(0).HeaderText = "Reports"
For Each dgrow As DataGridViewRow In DataGridView1.Rows
If Not IsDBNull(dgrow.Cells("Files").Value) AndAlso dgrow.Cells("Files").Value IsNot Nothing Then
dgrow.Cells("Files").Value = dgrow.Cells("Files").Value.ToString.Replace("files\",").Replace(".pdf", "")
Catch ex As Exception
MsgBox("Error while executing: (" & cmd.CommandText & ")" & vbCrLf & "Msg: " & ex.Message.ToString, MsgBoxStyle.Exclamation, "Error")
da = Nothing
ds = Nothing
dt = Nothing