strConnect= "......." Set g_dbs = OpenDatabase("", False, False, strConnect) strSql = "..." Set rs = g_dbs.OpenRecordset(strSql, 2, 64) 我现在在执行 Set rs = g_dbs.OpenRecordset(strSql, 2, 64) 前判断要操作的表是否已经被锁定了? 如果被锁定了,就等待解锁以后再操作. [因为现在程序报错,就说ODBC错误,有别的程序对该表操作]
用on error goto My_Err反复操作,如果如:private function blMyFun() as boolean blMyFun_Head: on error goto blMyFun_Err '打开操作 if 打开成功 then blMyFun=true exit function end if exit function blMyFun_Err: goto blMyFun_Head exit function end function
Set g_dbs = OpenDatabase("", False, False, strConnect)
strSql = "..."
Set rs = g_dbs.OpenRecordset(strSql, 2, 64)
我现在在执行 Set rs = g_dbs.OpenRecordset(strSql, 2, 64) 前判断要操作的表是否已经被锁定了? 如果被锁定了,就等待解锁以后再操作.
[因为现在程序报错,就说ODBC错误,有别的程序对该表操作]
blMyFun_Head:
on error goto blMyFun_Err
'打开操作
if 打开成功 then
blMyFun=true
exit function
end if
exit function
blMyFun_Err:
goto blMyFun_Head
exit function
end function