|
Sorry for no Chinese system of mine.
call it: ParamValue("WinZip_FOLDER")
Both of query "qry_ParameterGet" and table "z_Parameters" are exists.
source:
Public Property Get ParamValue(ByVal strItem As String) As String
Dim objDB As Database
Dim objQuery As QueryDef
Dim objRecset As Recordset
Dim sEnv As String
Set objDB = CurrentDb
Set objQuery = objDB.QueryDefs("qry_ParameterGet")
objQuery.Parameters("[ParameterItem]").Value = strItem
Set objRecset = objQuery.OpenRecordset 'wrong ! pop error msg "Type mismatch" ,why?!
If Not (objRecset.BOF And objRecset.EOF) Then
ParamValue = objRecset.Fields("Value").Value
If UCase(Right(strItem, 6)) = "WRKDIR" Then
' Set the temp variable
sEnv = Trim(Environ("TEMP"))
If (sEnv = "") Then
sEnv = ""
End If
ParamValue = sEnv & ParamValue
End If
Else
ParamValue = ""
End If
End Property
|
|