Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

obtain result from query or cursor

Status
Not open for further replies.

delpisaro

Programmer
Jun 18, 2003
19
HK
How can i get the result of a query ?

my original coding is

Use abc
GOTO bottom in abc
row_no = recno()


select a from abc where recno() = row_no into cursor tmp

abc_result = tmp


how can i get the result of "select a from abc where recno() = row_no" and display on a form.

thanks a lot .....
all welcome
 
delpisaro,

select A from abc where recno() = row_no into cursor TMP

"TMP" is the result of your query. You can treat it just like a normal table. Beware, once you close this "table" it can't be use anymore.
For example:

Select TMP
Go bottom
abc_result = A
abc_result = TMP.A
? abc_result, A, TMP.A

Hope it helps

-- AirCon --
 
HI

SELECT a FROM abc WHERE recno() = row_no

will show the rsult in a browse screen automatic. However, when you close the browse, everything is gone..

Instead.. you can also do..

SELECT abc
GO BOTTOM
SCATTER MEMVAR
Now the memory is populated with all fields of the last record.

? m.a ... to display memory.fieldA
or if that is char type field..
WAIT WINDOW m.a

or whatever etc. There is no need even to do a select and then get it to a variable.

If only the last record need to be browsed..
SELECT abc
go bottom
BROW FOR NEXT 1 NOUPDATE NOAPPEND

:)

:)



ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
If you just want the value of field "a" from the last record of table abc you don't need any query. When you do GO BOTTOM your result is already there: abc.a

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top