'使后臺可以正常訪問
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
新聞熱點
疑難解答