home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 July & August
/
Pcwk7897.iso
/
mgxsuite
/
abc.z
/
RECORD.BAS
< prev
next >
Wrap
BASIC Source File
|
1996-12-16
|
2KB
|
79 lines
Attribute VB_Name = "RECORD1"
Option Explicit
Type RECORD
Server As String * 50
Type As String * 50
User As String * 50
Computer As String * 50
UserID As String * 10
End Type
Dim NetSource As RECORD
Declare Sub CopyMemory Lib "KERNEL32" Alias "RtlMoveMemory" (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
Function GetCurrRec(ds As Recordset) As String
Dim J As Integer
Static FieldStr As String
Static recStr As String
recStr = ""
For J = 0 To ds.Fields.Count - 1
FieldStr = Space(ds.Fields(J).Size)
Select Case ds.Fields(J).Type
Case 1, 2
CopyMemory ByVal FieldStr, CInt(ds.Fields(J).Value), ds.Fields(J).Size
Case 3
CopyMemory ByVal FieldStr, CInt(ds.Fields(J).Value), ds.Fields(J).Size
Case 4
CopyMemory ByVal FieldStr, CLng(ds.Fields(J).Value), ds.Fields(J).Size
Case 5
CopyMemory ByVal FieldStr, CCur(ds.Fields(J).Value), ds.Fields(J).Size
Case 6
CopyMemory ByVal FieldStr, CSng(ds.Fields(J).Value), ds.Fields(J).Size
Case 7, 8
CopyMemory ByVal FieldStr, CDbl(ds.Fields(J).Value), ds.Fields(J).Size
Case 9, 10
CopyMemory ByVal FieldStr, ByVal CStr(ds.Fields(J).Value), Len(ds.Fields(J).Value)
End Select
recStr = recStr + FieldStr
Next
GetCurrRec = recStr
End Function
Function GetRecNum(ds As Recordset) As Integer
Static recNumber As Integer
recNumber = 0
Do While Not ds.EOF
If Not ds.Fields("User").Value = "" Then
recNumber = recNumber + 1
ds.MoveNext
End If
Loop
GetRecNum = recNumber
End Function