|
7#
楼主 |
发表于 2009-12-8 10:45:29
|
只看该作者
Private Sub Form_Open(Cancel As Integer)
Dim Cn As ADODB.Connection
Dim Rs As ADODB.Recordset
Dim strSQL$
strSQL = CurrentDb.QueryDefs("查询1").SQL
Set Cn = CurrentProject.AccessConnection
Set Rs = New ADODB.Recordset
Rs.Open strSQL, Cn, adOpenForwardOnly, adLockReadOnly
Rs.MoveFirst
Rs.MoveNext
Me.Text1 = Rs("姓名")
Me.Text3 = Rs("年龄")
Rs.Move (2)
Me.Text2 = Rs("姓名")
Me.Text4 = Rs("年龄")
Set Rs = Nothing
Set Cn = Nothing
End Sub |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|