hi
try changing the 1 to 2 in loadbyField parameter
oQuery.LoadByField(1,"Test Parents")
oQuery.LoadByField(2,"Test Parents")
(of course make sure you have a query called 'Test Parents' on RE!)
This works for me, RE 7.95 IOM 2.7.1.6 - all it does is count records in my Query
'Import has not been started yet
Dim oq As New Blackbaud.PIA.RE7.BBREAPI.CQueryObject
Dim qLen As Long
oq.Init(import.SessionContext)
oq.LoadByField(2, "test_myRecords")
oq.QuerySet.OpenQuerySet
qlen=oq.QuerySet.NumberOfRecords
msgbox(qlen)
oq.CloseDown
Lisa Folger
Thanks for any help anyone has.
Public wdParents(,) As String 'array that holds data from "Parents Alum Donors Volunteers"
Public queryLength As Long 'the length of the "Test Parents" query
Public Overrides Sub BeforeImport(ByVal Cancel As ImportOM.API.iCancel)
MyBase.BeforeImport(Cancel)
Dim oQuery As New Blackbaud.PIA.RE7.BBREAPI.CQueryObject
Dim queryLength As Long
oQuery.Init(Import.SessionContext)
oQuery.LoadByField(1,"Test Parents")
oQuery.QuerySet.OpenQuerySet
queryLength = oQuery.QuerySet.NumberOfRecords
Dim queryArray(queryLength,1) As String
wdParents = queryArray
Do While Not oQuery.QuerySet.EOF
wdParents(oQuery.QuerySet.RowNum, 0) = oQuery.QuerySet.fieldValue(1) 'this should hold the ID#
wdParents(oQuery.QuerySet.RowNum, 1) = oQuery.QuerySet.fieldValue(2) 'this should hold the name
oQuery.QuerySet.MoveNext
loop
oQuery.QuerySet.CloseDown
End Sub
Lisa Folger
Southern New Hampshire University