猴子李白单挑谁厉害:求教vb--ADO问题(求State属性详解)

来源:百度文库 编辑:高考问答 时间:2024/05/03 06:55:21
constr = "driver={sql server};server=(local);uid=" & Trim(Text1.Text) & ";password=" & Trim(txtpsw.Text) & ";database=master"
con.ConnectionString = constr
con.Open
If con.State = 2 Then
MsgBox "连接数据库失败", vbOKOnly, "提示"
con.Close
Else

去看MSDN,里面有