刚学,请教一个简单的问题
数据库连接:在窗体中这样连接数据库:
Private Sub Form_Load()
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=MSDASQL;driver={SQL Server};server=124.142.123.166;uid=2008;pwd=2008;database=2008;"
Set rs = New Recordset
rs.Open "select * from clickuser where UserName='" & A1 & "'", db, adOpenStatic, adLockOptimistic
End Sub
请高手指教:如何在写数据库连接模块,同时在窗体中如何写
谢谢