如题,在lotus表单中的一个文本域,能不能从sql server数据库中取到值呢?
谢谢!
------解决方案--------------------
%REM
'创建ADO连接对象
Set varCon=CreateObject( "ADODB.Connection ")
'连接字符串
strConStr={Provider=SQLOLEDB;Data Source=lmszmc.lmszmc.com;Uid=sa;Pwd=;Database=LMSMS}
'打开连接
varCon.open strConStr
'循环发送短信
For i=Lbound(strSendContent) To Ubound(strSendContent)
For j=Lbound(ArraySmsMobile) To Ubound(ArraySmsMobile)
'SQL语句
strSql={insert into ISSMTInit(TermNum,IContent) values( '} & Replace(ArraySmsMobile(j), " ' ", " ' ' ") & { ', '} & Replace(strSendContent(i), " ' ", " ' ' ") & { ')}
'执行SQL
varCon.Execute(strSql)
Next
Next
'关闭连接
varCon.close
%END REM
%REM
Dim con As New ODBCConnection 'ODBC连接对象
Dim qry As New ODBCQuery
Dim result As New ODBCResultSet
If Not con.ConnectTo( "SZMC ", "SZMC ", "SZMC ") Then '如果连接失败,退出过程
Exit Sub
Else
Set qry.Connection = con
Set result.Query = qry
qry.SQL= "select * from ISSMTInit "
result.Execute
result.LastRow
For i=Lbound(strSendContent) To Ubound(strSendContent)
For j=Lbound(ArraySmsMobile) To Ubound(ArraySmsMobile)
Call result.AddRow()
Call result.SetValue( "TermNum ",Replace(ArraySmsMobile(j), " ' ", " ' ' "))
Call result.SetValue( "IContent ",Replace(strSendContent(i), " ' ", " ' ' "))
result.UpdateRow
Next
Next
result.Close
'关闭连接
con.Disconnect
End If
%END REM
'创建LEI短信文档
Dim smsdb As NotesDatabase
Dim smsdoc As NotesDocument
Set smsdb=session.GetDatabase( "DServer ", "SZMCOA/db_Sms.nsf ")
'循环发送短信
Msgbox "OpenDB: " & smsdb.IsOpen
If smsdb.IsOpen Then
For i=Lbound(strSendContent) To Ubound(strSendContent)
For j=Lbound(ArraySmsMobile) To Ubound(ArraySmsMobile)
Set smsdoc=smsdb.CreateDocument()
smsdoc.FORM= "Sms "
smsdoc.Mobile=ArraySmsMobile(j)
smsdoc.Content=strSendContent(i)
Call smsdoc.Save(False,True)
Next
Next
End If