1个回答
展开全部
VB6.0使用ADO和datagrid连接access数据库的语句是:
Dim cn As New ADODB.Connection '定义数据库的连接
Dim rs As New ADODB.Recordset
Dim sql As String
sql = "select * from guzhang_sj" ' where madanhao='1'"
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\wd.mdb;Persist Security Info=False"
cn.Open
rs.CursorLocation = adUseClient
rs.Open sql, cn, adOpenDynamic, adLockOptimistic
Set DataGrid1.DataSource = rs
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询