根据以下代码,显示的错误为Type 'DataAccess' is not defined
。我应该导入什么以删除此错误?
Protected Sub ExportPOS(ByVal sender As Object, ByVal e As DirectEventArgs)
Handles ExportButton.Click
Try
Make Connection
Dim cnn As DataAccess = New DataAccess(Libatelconnectionstring)
........
答案 0 :(得分:0)
尝试此例程(来自MSDN)..
Public Sub ConnectToAccess()
Dim conn As New System.Data.OleDb.OleDbConnection()
' TODO: Modify the connection string and include any
' additional required properties for your database.
conn.ConnectionString = & _
"Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & _
"C:\Documents and Settings\username\My Documents\dbFile.mdb"
Try
conn.Open()
' Insert code to process data.
Catch ex As Exception
MessageBox.Show("Failed to connect to data source")
Finally
conn.Close()
End Try
End Sub