# Re: 关于vb及access问题--非常的紧急

Posted by 小丸子 on October 05, 1999 at 11:56:46:

In Reply to: Re: 关于vb及access问题--非常的紧急 posted by 卤肉脚 on October 05, 1999 at 11:46:44:

: 请确定你的
: 软体版本，windows环境，access2000 or 97,95
: 存取资料库的指令
: 将它写出来

我是用vb6.0来开发程式的
run在nt4.0
资料库是用access97

程式其中开启资料库的function如下:

Public Function OpenNTDB() As Boolean ''8/23改
On Error Resume Next
Dim sDBFname$, idx%
OpenNTDB = False
idx = 1
Do
sDBFname = GetIniStr("DataBase", "DBFname" + Format$(idx))
If sDBFname = "" Then Exit Do
Err.Clear
Set gDB = OpenDatabase(sDBFname)
If Err <> 0 Then
Call WriteLog("sytstock OpenNTDB >>", sDBFname + "|" + Format$(Err) + Error)
Else
OpenNTDB = True
gsNFSPath = GetIniStr("Setup", "NFSPATH") ''加入旧版
Exit Function
End If
idx = idx + 1
Loop While True
End Function

Follow Ups: