帮我解释一下vb连接数据库的代码
PublicconAsSqlConnectionPublicstrSQLAsStringPublicsql命令AsData.SqlClient.SqlCommandPub...
Public con As SqlConnection
Public strSQL As String
Public sql命令 As Data.SqlClient.SqlCommand
Public dr As Data.SqlClient.SqlDataReader
Public CurUser As String
Public MainFlag As Integer
Public ds内存 As DataSet
Public QXFlag As Boolean
Public sql适配器 As Data.SqlClient.SqlDataAdapter
Public Sub Setsql适配器(ByVal CSstrSQL As String, ByVal BM As String)
con.Close()
con.Open()
ds内存 = New DataSet
sql适配器 = New SqlDataAdapter(strSQL, con)
If ds内存.Tables.Contains(BM) Then
ds内存.Tables(BM).Clear()
End If
sql适配器.Fill(ds内存, BM)
End Sub 展开
Public strSQL As String
Public sql命令 As Data.SqlClient.SqlCommand
Public dr As Data.SqlClient.SqlDataReader
Public CurUser As String
Public MainFlag As Integer
Public ds内存 As DataSet
Public QXFlag As Boolean
Public sql适配器 As Data.SqlClient.SqlDataAdapter
Public Sub Setsql适配器(ByVal CSstrSQL As String, ByVal BM As String)
con.Close()
con.Open()
ds内存 = New DataSet
sql适配器 = New SqlDataAdapter(strSQL, con)
If ds内存.Tables.Contains(BM) Then
ds内存.Tables(BM).Clear()
End If
sql适配器.Fill(ds内存, BM)
End Sub 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询