Access数据库软件版本号保存在INI文件中,然后从INI文件中提取版本号

【Access数据库软件版本号保存在INI文件中,然后从INI文件中提取版本号】分享给互联网技能从业者学习和参考。

很久以前帮客户做的一个客户管理系统,有一个取软件版本号的函数,感觉还有点用,与大家分享一下

Access数据库软件版本号保存在INI文件中,然后从INI文件中提取软件的当前版本号(可用来与服务器的最新版本号对比,然后提示是否需要更新)

 

'软件版本号保存在INI文件中,然后从INI文件中提取版本号
Private Sub GetCurrVer()
'作者:tmtony 2003-02-03
Dim sLine As String, iPos As Integer, sTmp As String
Dim sFormName As String, sTmp2 As String
Dim bFormFound As Boolean
Dim intType As Integer
Dim iPos2 As Integer
Dim iSubIndex As Integer
Dim iIndex As Integer
Dim sFile As String

sFile = CurrentProject.Path & "cn2005.ini"

Open sFile For Input As #1
Do

Input #1, sLine

If Left$(sLine, 1) = ";" Or sLine = "" Then GoTo Jump


iPos = InStr(sLine, "=")

'sTmp = Mid$(sLine, iPos + 1, InStr(sLine, "=") - iPos - 1)

If iPos > 0 Then
sTmp = Left$(sLine, iPos - 1)
'If sTmp = "Version" Then
sTmp2 = Mid$(sLine, InStr(sLine, "=") + 2)
'End If
If Right$(sTmp2, 1) = Chr$(34) Then sTmp2 = Left$(sTmp2, Len(sTmp2) - 1)
Select Case sTmp
Case "Version"
txtCurrVersion = sTmp2
Case "VersionDate"
txtCurrVersionDate = sTmp2
Case "Path"
Me.txtCurrPath = sTmp2

End Select

GoTo Jump
End If

Jump:


Loop Until EOF(1)

Close #1
txtCurrPath = Nz(CurrentProject.Path)
End Sub

Access数据库软件版本号保存在INI文件中,然后从INI文件中提取版本号