lotus domino数据库与sql server 进行连接

2024-11-08 08:45:01
推荐回答(3个)
回答1:

完全可以呀,先定义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

回答2:

需要引入对应的Jar包,SQL server2000和SQL server2005的jar都不一样,2000是三个jar包,2005的只用一个jar包,然后把jar包放在Domino服务器和开发的客户端的\jvm\lib\ext路径中。具体JDBC的代码写的代码网上很多(2000和2005都不一样,看实际情况)。

回答3:

使用Stream对象