在表单上显示MS Access嵌入式链接

时间:2014-08-04 19:19:10

标签: vb.net ms-access

我有一个vb.net表单,可以插入一个MS Access数据库。我的一个数据库字段是指向文件夹位置的链接。

当我打开我的vb.net表单时,它会将链接显示为路径,并且不可点击。

有没有办法通过可点击的链接?

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'sSql = "SELECT AffectedEndUser as [Affected End User], IncidentArea as [Incident Area], ConfigItem as [Config Item], Summary, Description, ActivityLog as [Activity Log], AddedtoSDM as [Added to SDM] FROM SDM_Details ORDER BY ID"
        sSql = "SELECT Title, YearofFilm, Description, Field1 FROM Table1"
        LoadDS(sSql)

        FillGrid()
    End Sub



Private Sub LoadDS(ByVal sSQL As String)
        Try
            Dim cnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Redirection\dnapoli\Desktop\AccessDBs\MovieCatalog.mdb"
            'Open Connection.
            Dim conn As OleDbConnection = New OleDbConnection(cnString)

            'Set the DataAdapter's query.
            da = New OleDbDataAdapter(sSQL, conn)
            ds = New DataSet()

            ' Fill the DataSet.
            da.Fill(ds, "Items")

            ' Set the source table.
            dtSource = ds.Tables("Items")
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error...", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

 Private Sub FillGrid()

        'Set the start and max records. 
        pageSize = 8 'txtPageSize.Text
        maxRec = dtSource.Rows.Count
        PageCount = maxRec \ pageSize

        ' Adjust the page number if the last page contains a partial page.
        If (maxRec Mod pageSize) > 0 Then
            PageCount = PageCount + 1
        End If

        'Initial seeings
        currentPage = 1
        recNo = 0

        ' Display the content of the current page.
        LoadPage()
    End Sub

0 个答案:

没有答案