The below example explains how to create the recordset and fill our own values using VB 6.0
If you want to run the below code, you need to add a reference of Microsoft Activex Data Objects 2.8 Library using References under Project.
Dim SpecailizedFunds As String
Dim fields() As String
SpecailizedFunds = "123456,456789"
fields() = Split(SpecailizedFunds, ",")
Dim rsTemp As ADODB.Recordset
Set rsTemp = New ADODB.Recordset
rsTemp.ActiveConnection = Nothing
rsTemp.CursorLocation = adUseClient
rsTemp.LockType = adLockBatchOptimistic
'create fields
rsTemp.fields.Append "Account", adChar, 6
rsTemp.Open
For i = 0 To UBound(fields)
rsTemp.AddNew
rsTemp.fields(0) = fields(i)
If Not rsTemp.EOF Then rsTemp.MoveNext
Next
If rsTemp.RecordCount > 1 Then
rsTemp.MoveFirst
Do Until rsTemp.EOF
MsgBox rsTemp.fields("Account").Value
rsTemp.MoveNext
Loop
End If
rsTemp.Close
Set rsTemp = Nothing
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment