Lotus Domino能用sql server 2005 数据库吗? 是否兼容? 怎样连接?(连接代码怎么写)
2个回答
展开全部
完全可以呀,先定义ODBC,再用LS类似如下书写(要先引用Uselsx "*LSXODBC"):
Dim l_ses_Cur As New NotesSession
Dim l_db_Cur As NotesDatabase
Dim l_dc_Tmp As NotesDocument
Dim l_itm_Temp As NotesItem
Dim l_con_Temp As ODBCConnection
Dim l_qry_Temp As ODBCQuery
Dim l_rst_Temp As ODBCResultSet
Set l_db_Cur=l_ses_Cur.CurrentDatabase
'连接数据库
Set l_con_Temp = New ODBCConnection
Set l_qry_Temp = New ODBCQuery
Set l_rst_Temp = New ODBCResultSet
Set l_qry_Temp.Connection = l_con_Temp
Set l_rst_Temp.Query = l_qry_Temp
l_con_Temp.ConnectTo("bjht_arch")
l_qry_Temp.SQL = "SELECT * FROM main"
If Not l_rst_Temp.Execute Then
Messagebox l_rst_Temp.GetExtendedErrorMessage,, l_rst_Temp.GetErrorMessage
Exit Sub
End If
l_rst_temp.Execute
Dim l_ses_Cur As New NotesSession
Dim l_db_Cur As NotesDatabase
Dim l_dc_Tmp As NotesDocument
Dim l_itm_Temp As NotesItem
Dim l_con_Temp As ODBCConnection
Dim l_qry_Temp As ODBCQuery
Dim l_rst_Temp As ODBCResultSet
Set l_db_Cur=l_ses_Cur.CurrentDatabase
'连接数据库
Set l_con_Temp = New ODBCConnection
Set l_qry_Temp = New ODBCQuery
Set l_rst_Temp = New ODBCResultSet
Set l_qry_Temp.Connection = l_con_Temp
Set l_rst_Temp.Query = l_qry_Temp
l_con_Temp.ConnectTo("bjht_arch")
l_qry_Temp.SQL = "SELECT * FROM main"
If Not l_rst_Temp.Execute Then
Messagebox l_rst_Temp.GetExtendedErrorMessage,, l_rst_Temp.GetErrorMessage
Exit Sub
End If
l_rst_temp.Execute
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询