下面代码是同库引用,如如何实现跨库引用?订单表是外部A数据库,产品表是外部B数据库,如何实现外部A数据库的订单表的字段,引用外部B数据库的产品表的字段?
If e.DataCol.Name = "产品编号" Then
If e.NewValue Is Nothing Then
e.DataRow("品名") = Nothing
e.DataRow("型号") = Nothing
e.DataRow("规格") = Nothing
e.DataRow("单价") = Nothing
Else
Dim dr As DataRow
dr = DataTables("产品").Find("[产品编号] = '" & e.NewValue & "'")
If dr IsNot Nothing
e.DataRow("品名") = dr("品名")
e.DataRow("型号") = dr("型号")
e.DataRow("规格") = dr("规格")
e.DataRow("单价") = dr("单价")
End If
End If
End If