1,包括姓名,年龄,家庭住址,性别等。、
2,表中各条记录能进行插入,删除,更新,查询等操作。
程序如下:
Private Sub Command1_Click()
Dim cn As ADODB.Connection
Dim cmd As ADODB.Command
Dim par As ADODB.Parameter
Dim rst As ADODB.Recordset
Set conn = New ADODB.Connection
conn.ConnectionString = "Provider=MSDASQL;DRIVER={SQL SERVER};" + _
"SERVER=USER67;UID=sa;PWD=;DATABASE=pubs"
conn.Open
Set cmd = New ADODB.Command
cmd.ActiveConnection = conn
cmd.CommandType = adCmdText
cmd.CommandText = "Select * from authors where contract=?"
Set par = cmd.CreateParameter(, adInteger, adParamInput, , _
Val(Text1.Text))
cmd.Parameters.Append par
Set rst = cmd.Execute
List1.Clear
List1.AddItem (" au_id au_name phone")
List1.AddItem ("==================================================")
Do While Not rst.EOF
List1.AddItem (rst("au_id") + " " + rst("au_fname") + _
rst("au_lname") + " " + rst("phone"))
rst.MoveNext
Loop
rst.Close
conn.Close
End Sub
在线等回复啊~!~!~!~!