dim rs as new ado.recordset
dim cn as new ado.connection
dim strsql as string
private form_load ()
cn.open "数据源名"
strsql="select * from 表名"
rs.open strsql,cn中间是执行语句rs.close(关闭数据库)
set cn=nothing
end sub
给分吧!!
dim cn as new ado.connection
dim strsql as string
private form_load ()
cn.open "数据源名"
strsql="select * from 表名"
rs.open strsql,cn中间是执行语句rs.close(关闭数据库)
set cn=nothing
end sub
给分吧!!
创建一个新connection也不要是全局变量。