[求助]程序运行报错,请求高手指点!!!!
运行程序的时候报错,“编译错误:未找到方法或数据成员”报错代码段如下,光标停在第一行
Private Sub Form_Load()
Dim db As New DataBases
Adodc1.ConnectionString = db.sConn
LoadData
SetTextBoxState (False)
End Sub
顺便贴下Databases的代码(估计应该是这段有点问题。。。。。。。吧)
Public SqlConn As ADODB.Connection
Public rs As New ADODB.Recordset
Const sConn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;" & _
"Persist Security Info=False;Initial Catalog=ch1;Data Source=."
Public Sub OpenConn()
If SqlConn Is Nothing = True Then
'建立数据库连接对象
Set SqlConn = New ADODB.Connection
End If
If SqlConn.State <> 1 Then
'打开数据库连接
SqlConn.Open sConn
End If
End Sub
Public Sub CloseConn()
'如果数据库连接对象不为空则关闭数据库连接
If SqlConn.State = 1 Then
SqlConn.Close
End If
End Sub
Public Function RunSelectSQL(ByVal sSQLString As String) As ADODB.Recordset
'打开数据库连接
Me.OpenConn
'执行SQL操作
rs.Open sSQLString, SqlConn, adOpenStatic, adLockReadOnly
End Function
由于毕业设计的原因刚接触VB,基本属于菜鸟一只,请高手指点!!!!!