vb 程序报错
PrivateSubForm_Load()DimconnAsadodb.connectionSetconn=Newadodb.connectionconn.Connect...
Private Sub Form_Load()
Dim conn As adodb.connection
Set conn = New adodb.connection
conn.ConnectionString = "driver={sql server};" & "server=dengjiaxiong;uid="";pwd="""
conn.defaultdatabase = "nengyuan"
conn.open
If conn.state = adstateopen Then
MsgBox "connection successfull!"
conn.Close
End Sub 此程序作用是用来连接sql数据库。。提示是说没有定义 初学请指教。。。。 报错提示 对象关闭时 不允许操作 而conn.DefaultDatabase = "nengyuan" 是报错语句 求高手指点 展开
Dim conn As adodb.connection
Set conn = New adodb.connection
conn.ConnectionString = "driver={sql server};" & "server=dengjiaxiong;uid="";pwd="""
conn.defaultdatabase = "nengyuan"
conn.open
If conn.state = adstateopen Then
MsgBox "connection successfull!"
conn.Close
End Sub 此程序作用是用来连接sql数据库。。提示是说没有定义 初学请指教。。。。 报错提示 对象关闭时 不允许操作 而conn.DefaultDatabase = "nengyuan" 是报错语句 求高手指点 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询