Ms access 你想省钱
让我知道这个解决方案是否适合您Ms access 你想省钱,ms-access,ms-access-2010,Ms Access,Ms Access 2010,让我知道这个解决方案是否适合您 拜拜:-)列表框的确切行源是什么?行源是一个名为Radius的表。行源类型为Table/Query。因此表半径有三行,值为“Local”、“Regional”和“National”?是的,这是正确的。列表框允许我从表中选择本地、地区或国家。Chris,tsk,tsk,你发了一篇重复的帖子-真的不是一个好主意。。。如果你不明白你得到的回答,请说出来。如果你想提出一个重复的问题,请在你以前的帖子中提及。 '-------------------------------
拜拜:-)列表框的确切行源是什么?行源是一个名为Radius的表。行源类型为Table/Query。因此表半径有三行,值为“Local”、“Regional”和“National”?是的,这是正确的。列表框允许我从表中选择本地、地区或国家。Chris,tsk,tsk,你发了一篇重复的帖子-真的不是一个好主意。。。如果你不明白你得到的回答,请说出来。如果你想提出一个重复的问题,请在你以前的帖子中提及。
'---------------------------------------------------------------------------
' Load configuration file if existing
' Return False if not loaded
' Each valid line is in the form <Keyword>=<Value>
'---------------------------------------------------------------------------
Public Function LoadConfig(strCfgFilePath As String) As Boolean
Dim fso As FileSystemObject
Dim ts As TextStream
Dim vnt As Variant
Dim strReadLine As String
Dim intNumParams As Integer
LoadConfig = False ' Set default return value to False (w/ errors)
'-------------------------------------------------
' Exit if config file not found
'-------------------------------------------------
Set fso = New FileSystemObject
If Not fso.FileExists(strCfgFilePath) Then
Set fso = Nothing
Exit Function
End If
Set ts = fso.OpenTextFile(strCfgFilePath) ' Open config file
intNumParams =1 ' Fixed number of parameters that must be read
'-------------------------------------------------
' LOOP - Read all lines of the config file
'
Do While Not ts.AtEndOfStream
strReadLine = ts.ReadLine ' Read a line
vnt = Split(strReadLine, "=") ' Extract the words from the line read
'-------------------------------------------------
' IF - 2 words must be found
'
If Not IsEmpty(vnt) Then
If UBound(vnt) = 1 Then
Select Case CStr(vnt(0))
Case "RegionalSetting" ' Keyword of the parameter to be read
g_strRegionalSettings = vnt(1) ' Assign parameters to global variables
intNumParams = intNumParams - 1
'Add parameters here ....
End Select
End If
End If
'
' END IF - 2 words must be found
'-------------------------------------------------
Loop
'
' LOOP END - Read all lines of the config file
'-------------------------------------------------
If intNumParams = 0 Then
LoadConfig = True ' Set result = TRUE if all params has been read
End If
ts.Close ' Close config file
Set ts = Nothing ' Release memory
Set fso = Nothing
End Function
'---------------------------------------------------------------------------
' Write configuration file
' Return False in case of errors
' Lines are in the form <Keyword>=<Value>
'---------------------------------------------------------------------------
Public Function WriteConfig(strCfgFilePath As String) As Boolean
On Error GoTo Err_WriteConfig
Dim fso As FileSystemObject
Dim ts As TextStream
Set fso = New FileSystemObject
Set ts = fso.CreateTextFile(strCfgFilePath, True) ' Create text file (Overwrite if existing)
ts.WriteLine "RegionalSetting" + "=" + g_strRegionalSettings ' Write lines
WriteConfig = True ' Set result = TRUE
Exit_WriteConfig:
ts.Close ' Close file and release memory
Set ts = Nothing
Set fso = Nothing
Exit Function
Err_WriteConfig:
WriteConfig = False ' Set result to FALSE in case of any errors
End Function