vb6.0連接數據庫的方法?Dim con As New ADODB.Connection Dim rs As New ADODB.RecordsetDim connstrf3 As StringIf rs.State = adStateOpen Then rs.CloseIf con.State = adStateOpen Then con.Close,接下來我們就來聊聊關于vb6.0連接數據庫的方法?以下内容大家不妨參考一二希望能幫到您!
Dim con As New ADODB.Connection Dim rs As New ADODB.RecordsetDim connstrf3 As String
If rs.State = adStateOpen Then rs.CloseIf con.State = adStateOpen Then con.Close
connstrf3 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\數據庫名.mdb;Persist Security Info=False"con.ConnectionString = connstrf3con.Opencon.CursorLocation = adUseClient
rs.Open "SELECT * FROM 老師 WHERE 教師編号='" & Text9.Text & "'", con, , adLockOptimisticSet DataGrid1.DataSource = rs
,更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!