然後在套表的postopen事件中輸入下列程式碼
Sub Postopen(Source As Notesuidocument)
Set con=New ODBCConnection
Set qry=New ODBCQuery
Set rs=New ODBCResultSet
Set qry.Connection = con
Set rs.Query=qry
Set ws=New notesuiworkspace
Set uidoc=ws.currentdocument
Call con.ConnectTo("project15_U","","")
qry.SQL="Select * From people"
rs.execute
If rs.IsResultSetAvailable Then
student_id=rs.GetValue("student_id")
CName=rs.GetValue("CName")
EName=rs.GetValue("EName")
Address=rs.GetValue("Address")
Tel=rs.GetValue("Tel")
Call uidoc.fieldsettext("student_id",student_id)
Call uidoc.fieldsettext("CName",CName)
Call uidoc.fieldsettext("EName",EName)
Call uidoc.fieldsettext("Address",Address)
Call uidoc.fieldsettext("Tel",Tel)
End If
End Sub
在”列出所有人資料”按鈕中的Click事件中建立同樣的程式碼,並把Sub Postopen(Source As Notesuidocument)改成Sub Click(Source As Button)即可作者: azerow 时间: 2008-01-02 11:24
支持~虽然看得不大明白