|
|
发表于 2005/4/7 15:53:03
|
显示全部楼层
1、首先在本级建立一个ODBC数据源
2、再参考以下例子:
Dim session As New notessession
Dim workspace As New notesuiworkspace
Dim uidoc As notesuidocument
Dim db As notesdatabase
Set db=session.currentdatabase
Dim con As New ODBCConnection
Dim qry As New odbcquery
Dim res As New odbcresultset
Dim status As Variant
Set uidoc=workspace.currentdocument
Dim user As String
user=session.commonusername
Dim dateTime As NotesDateTime
Set dateTime = New NotesDateTime( "Today" )
status=con.connectto("testuser","sitech_test","111111")
Set qry.connection=con
'qry.sql="select * from DAILY_REPORT where WORK_ID = '" + user + "' and DAY_DATE = '" + dateTime.LocalTime + "' and STATUS in ('1','2')"
qry.sql="select * from DAILY_REPORT where ISERIAL_NO=1448"
Set res.query=qry
Call res.execute
If res.getvalue("ISERIAL_NO")="False" Then
Msgbox "您今天还未提交了日报!"
Else
Msgbox "您可以签退了!"
End If
res.close
con.disconnect |
|