アクセス データベースに履歴を書き込もうとしていますが、エラーが発生し続けますthe path is invalid
。接続文字列を使用しており、ウィザード自体から取得しています。コピーアンドペースト。誰でも私を助けることができますか?
ありがとう
Imports System.IO
Imports System.Data.OleDb
Public Class theControls
'The History Database Connection String
Dim theHistoryDatabaseConn As New OleDbConnection
Private Sub ComboBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles theAddressBar.KeyDown
'Navigate to Webpage stated in theAddressBar
If e.KeyValue = Keys.Enter Then
theBrowser.Navigate(theAddressBar.Text)
e.SuppressKeyPress = True
End If
End Sub
Private Sub goForward_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles goForward.Click
theBrowser.GoForward()
End Sub
Private Sub goBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles goBack.Click
theBrowser.GoBack()
End Sub
Private Sub theBrowser_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles theBrowser.DocumentCompleted
'Set Tab Text to current web page
Form1.TabControl1.SelectedTab.Text = theBrowser.Url.Host.ToString
'The History
theHistoryDatabaseConn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\bin\Debug\TheHistoryDB.accdb"
Dim theCommand As OleDbCommand = New OleDbCommand("INSERT INTO TheHistory ([Site]) VALUES (theBrowser.URL.Host)", theHistoryDatabaseConn)
theCommand.Parameters.Add("@Site", OleDbType.Char, 255).Value = theBrowser.Url.Host.ToString
Try
theHistoryDatabaseConn.Open()
theCommand.ExecuteNonQuery()
Catch ex As Exception
Throw ex
Finally
theHistoryDatabaseConn.Close()
End Try
theHistoryDatabaseConn.Close()
End Sub
Private Sub theBrowser_ProgressChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles theBrowser.ProgressChanged
'Status Bar Text
Label1.Text = theBrowser.StatusText.ToString
End Sub
End Class