modcommon.vb
来自「Visual Basic Oracle数据库联接」· VB 代码 · 共 30 行
VB
30 行
'Throw back from vb6 BAS module
Module CommonBAS
'Location of XML Files
Public m_AppPath As String = Application.StartupPath
'Connection paths / File locations
Public m_ParentPath As String
Public m_connProducts As String = "\Data\Products.xml"
Public m_connCustomers As String = "\Data\Customers.xml"
'String used to setup customized IDs
Private Const abc As String = "02346789ABDEFGHKLMNOPQRSTVWXY"
Public Function GenerateID(Optional ByVal sPrefix As String = "DAT", Optional ByVal vDataSeed As String = "4") As String
Dim vDataGUID As String
Dim r, i As Single
For i = 0 To 4
Randomize()
r = Int((Rnd() * 45) + 1)
vDataGUID = vDataSeed & Mid(abc, CType(r, Integer), 1)
vDataSeed = vDataGUID & Int((Rnd() * 23) + 6)
Next i
If Not sPrefix = vbNullString Then vDataSeed = Microsoft.VisualBasic.Left(UCase(sPrefix), 3) & vDataSeed
GenerateID = vDataSeed
End Function
End Module
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?