vb6.0连接数据库的方法(VB6.0中mdb数据库经典连接)
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连接数据库的方法?以下内容大家不妨参考一二希望能帮到您!
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
,免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com