Include a reference to Component One XArrayDB Object, then try the
following. I'll use an already-loaded ADO Recordset as the source of data:
Option Explicit
Private mArray As XArrayDB
Private adoTasks As Recordset
Private Const COL_STATUS As Integer = 0
Private Const COL_SUBJECT As Integer = 1
Private Const COL_ETC As Integer = 2
Private Const COL_FIRST_COL As Integer = COL_STATUS
Private Const COL_LAST_COL As Integer = COL_ETC
Private Sub psLoadXArrayDB()
Dim i As Integer
Dim lvStatus As Variant
Dim lvSubject As Variant
Dim lvEtc As Variant
Set mArray = New XArrayDB
TDBGrid1.Array = mTaskArray
If Not adoTasks Is Nothing Then
With adoTasks
If .State <> 0 Then
i = -1
While Not .EOF
i = i + 1
mArray.ReDim 0, i, COL_FIRST_COL, COL_LAST_COL
lvStatus = !Status
mArray(i, COL_STATUS) = lvStatus
lvSubject = !Subject
mArray(i, COL_SUBJECT) = lvSubject
lvEtc = !Etc
mArray(i, COL_ETC) = lvEtc
.MoveNext
Wend
End If
End With
End If
TDBGrid1.ReBind
End Sub
Pete
-----Original Message-----
From: Kevin Son [mailto:KSon@c...]
Sent: Thursday, November 21, 2002 12:46 PM
To: professional vb
Subject: [pro_vb] TrueDBGrid
I am trying to use the TrueDBGrid in unbound mode. I can not seem to add a
row manually.
Does anybody know how to add a row? For example, in listbox I would use
.addnew method. But there is no method like that in TrueDBGrid.
Please help.
thanks,
Kevin