Help!
请各位大侠看看下面在access中编写的连接SQL的代码有何问题?如果有如何可以实现将SQL的记录集设为窗体的记录源?在次现谢谢了!Private Sub Form_Open(Cancel As Integer)
Set conn = New ADODB.Connection
Set rs = New ADODB.Recordset
conn.ConnectionString = "Driver={sql server};server=10.10.1.20;uid=sa;pwd=;database=MRPII"
conn.ConnectionTimeout = 30
conn.Open
rs.Open "select MA001,MA002,MA003,MA004 from INVMA", conn, adOpenStatic, adLockReadOnly, adCmdText
MsgBox rs.Fields("MA003").Value
Me.RecordSource = rs
End Sub