試圖Web服務器上創建的Access數據庫鏈接表時,得到錯誤的 - 錯誤是在ADOX.Catalog
不知道我是否需要繼承ADOX還是怎麼樣?創建鏈接表在MS-Access數據庫的Web服務器
錯誤是:
編譯器錯誤消息:BC30002:類型 'ADODB.Catalog' 沒有定義。
Protected Sub Page_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Load
''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim A As String = "e:\web\Training.mdb"
Dim B As String = "e:\web\LeaveDB.mdb"
Dim C As String = "UsersDataTbl"
Dim D As String = "NewUsers"
CreateLinkedAccessTable(A,B,C,D)
End Sub
Sub CreateLinkedAccessTable(strDBLinkFrom As String, strDBLinkTo As String, strLinkTbl As String, strLinkTblAs As String)
Dim catDB As ADOX.Catalog
Dim tblLink As ADOX.Table
Set catDB = New ADOX.Catalog
' Open a Catalog on the database in which to create the link.
catDB.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strDBLinkFrom
Set tblLink = New ADOX.Table
With tblLink
' Name the new Table and set its ParentCatalog property to the
' open Catalog to allow access to the Properties collection.
.Name = strLinkTblAs
Set .ParentCatalog = catDB
' Set the properties to create the link.
.Properties("Jet OLEDB:Create Link") = True
.Properties("Jet OLEDB:Link Datasource") = strDBLinkTo
.Properties("Jet OLEDB:Remote Table Name") = strLinkTbl
End With
' Append the table to the Tables collection.
catDB.Tables.Append tblLink
Set catDB = Nothing
End Sub
這裏是品嚐我使用的代碼的鏈接: http://msdn.microsoft.com/en-us/library/office/aa164914(v=office.10).aspx – BarclayVision
聽起來像是你缺少一個參考或進口。可能是一個金塊埋葬在這裏:http://allenbrowne.com/func-adox.html(在最頂端它談論裁判)看起來好像是我的系統 – Plutonix
是啊,一個COM對象,我看着那個,可以而她不知道該dll包括因爲我在做這個第三方服務器 – BarclayVision