dbTalk Databases Forums  

Activex SelectedRecords No Workie

comp.databases.btrieve comp.databases.btrieve


Discuss Activex SelectedRecords No Workie in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
myfriendhenry@yahoo.com
 
Posts: n/a

Default Activex SelectedRecords No Workie - 02-11-2005 , 03:18 PM






Hi, Hope a guru can help me with this. I create the VAccess in code
and the following works just great, but something tells me that I am
not performing this as efficently as possible. I can't seem to get the
SelectedRecords property to work for me so I do it this way instead. I
don't know if it my placement of the "init"'s or the quotes in the
SelectedRecords or the improper use of GetNextExtended as opposed to
StepNextExtended and the use of GetFirst or what? I think that I have
tried everything!
As you can see with the code below, I point to the beginning of the
place where the index begins for that date and time etc and it works
properly,but I have to test for a change in the XACT_DATE field to know
when to stop reading the file, once again seemingly ineffecient.

Could someone use my example and show me how to use the SelectedRecords
property using my example? (assuming this is the better solution)
Please keep in mind that I am doing all of this in code and that there
is no form. Also I am unsure about the quotes to use for
SelectedRecords.
SITENUMBER is an integer and the others are pervasive date fields.

Thanks in advance for any insight!

-Henry

With PervasiveDB
.AutoOpen = False
.AutoMode = False
.TableName = MyTable
.Location = MyLocation
.ExtendedOps = True
.SelectedFields = "XACT_TIME,LINE_NUMBER,XACT_DATE" '...Etc
.IndexNumber = 3
.FieldValue("ORIG_SITE_NUMBER") = SiteNumber
.FieldValue("XACT_DATE") = ThisDate
.FieldValue("XACT_TIME") = "00:00:00"
DayCompare = ThisDate
stat = .GetGreaterOrEqual
.Init
Do While stat = 0
stat = .GetNextExtended 'got it
For r = 1 To .Rows
If Day(.RowColumnValue(r, 3)) <> DayCompare Then Exit Do
.....ETC


Reply With Quote
  #2  
Old   
nelsonsoft
 
Posts: n/a

Default Re: Activex SelectedRecords No Workie - 02-14-2005 , 11:52 AM






Here is a little example. One thing I never had much success with the
..selectedfields as it did not work. But maybe version 8 fixes that.

VC.SOHDR.IndexNumber = 0
VC.SOHDRUPDATE.GetFirst 'move to the first position or to where you
want to start your extended search
VC.SOHDRUPDATE.IncludeCurrent = True
VC.SOHDRUPDATE.ExtendedOps = True
'use sSelect to store your selection
sSelect = "MyDATE" & " < " & Chr$(34) & "01/01/1990" & Chr$(34)
sSelect = sSelect & " & jobdate >= " & Chr$(34) &
txtStartCompleteDate.Text & Chr$(34)
sSelect = sSelect & " & jobdate <= " & Chr$(34) &
txtStopCompleteDate.Text & Chr$(34)
sSelect = sSelect & " & LOCATIONKEY >= " & Chr$(34) &
txtLocation.Text & Chr$(34) & " & LOCATIONKEY < " & Chr$(34) &
txtLocation.Text & Chr$(34)

VC.SOHDRUPDATE.SelectedRecords = sSelect
VC.SOHDRUPDATE.Init
VC.SOHDRUPDATE.GetNextExtended

While (VC.SOHDRUPDATE.Status = 0 Or VC.SOHDRUPDATE.Status = 60)
For lRow = 1 To VC.SOHDRUPDATE.Rows
VC.SOHDRUPDATE.Row = lRow
'do your processing
next
VC.SOHDRUPDATE.GETNEXTEXTENDED
WEND

Hope that helps,

Gil


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.