'使后台可以正常访问
function openht(htmdbpath as string)
dim fh as integer
fh = freefile
open htmdbpath for binary access write as #fh
put fh, 2, &h1
close #fh
end function
'使后台无法正常访问
function closeht(htmdbpath as string)
dim fh as integer
fh = freefile
open htmdbpath for binary access write as #fh
put fh, 2, &h0
close #fh
end function
'下面的都是跟后台建立物理连接的函数(必须放在模块里)
public htcn as connection
public htrs as new adodb.recordset
public htsql as string
'建立物理连接
function openstandht()
set htcn = currentproject.connection
'表1要改成相应的表名
htsql = "select * from 表1"
htrs.open htsql, htcn, 3, 3, 1
end function
'关闭物理连接的函数,如退出程序时,或需要压缩后台文件时就要关闭物理连接
function closestandht()
htrs.close
set htcn = nothing
end function
新闻热点
疑难解答