I'm converting a big app and till now in browses didn't need to change a single line of code!
Wonderful!
I'm converting a big app and till now in browses didn't need to change a single line of code!
nrec := recno()
if seek "whatever whatever2" // 2 fields in seek expression // 1) new recordset 2) the same
do while seek expression = .t.
....
skip
enddo
endif
go to nrec // 1) out of the scope needs to revert to previous record set 2) the same record set :find that record
AHF wrote:Cons: adordd has to do some guessing
Enrico Maria Giordano wrote:Antonio,AHF wrote:Cons: adordd has to do some guessing
Please explain this point.
EMG
nrec :=recno()
seek expression with 2 fields
browse()
go to nrec //error
set index to
go to nrec //ok
browse()
hmpaquito wrote:neither the first nor the second option, but both
my proposal:
basic programming: compatibility mode: 2nd option
advanced programming: 1st option. New command ADORDD_SEEK
Rick Lipkin wrote:Antonio
I use the ADO Class and methods to create recordsets to manage SQL.. and creating separate recordsets based on the primary key and the foreign key or a single recordset based on inner and outer joins.. not necessarily like we used to with .Dbf.
I am watching this thread with interest.
Rick Lipkin
Func _Invoice(nRepairNumber) // 354
Local cSql,oRsInvoice,oRsInvoiceDetail,oErr
...
...
..
cSql := "Select * from [Invoice] where [Invoice Number] = "+ltrim(str(nRepairNumber))
oRsInvoice := TOleAuto():New( "ADODB.Recordset" )
oRsInvoice:CursorType := 1 // opendkeyset
oRsInvoice:CursorLocation := 3 // local cache
oRsInvoice:LockType := 3 // lockoportunistic
TRY
oRsInvoice:Open( cSQL,xCONNECT )
CATCH oErr
MsgInfo( "Error in Opening INVOICE table" )
RETURN(.F.)
END TRY
If oRsInvoice:Eof
Msginfo( "Could not find Invoice "+trim(str(nRepairNumber)) )
oRsInvoice:CLose()
oRsInvoice := nil
Return(.f.)
Endif
// open detail table
cSql := "Select * from [InvoiceDetail] where [Invoice Number] = "+ltrim(str(nRepairNumber))
oRsInvoiceDetail := TOleAuto():New( "ADODB.Recordset" )
oRsInvoiceDetail:CursorType := 1 // opendkeyset
oRsInvoiceDetail:CursorLocation := 3 // local cache
oRsInvoiceDetail:LockType := 3 // lockoportunistic
TRY
oRsInvoiceDetail:Open( cSQL,xCONNECT )
CATCH oErr
MsgInfo( "Error in Opening INVOICEDETAIL table" )
oRsInvoice:CLose()
oRsInvoice := nil
RETURN(.F.)
END TRY
oRsInvoice:MoveFirst()
oRsInvoice:Find( "[InvoiceNumber] = "+ltrim+str(nRepairNumber)) )
or
oRsInvoice:Filter := "[InvoiceNumber] = "+ltrim+str(nRepairNumber))
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 58 guests