AW: AW: RecID from Cursor
Claudius Sailer
Claudius at sailer-online.de
Tue Feb 15 21:32:30 CST 2005
Hi,
Am 15. Feb 2005 um 21:23 Uhr schrieb Florian Bogeschdorfer:
> I guess you got to wait for other (Real Basic) people to start working
> again. Ruslan is probably out of office (its about 1 am over there) :-)
>
> Florian
>
>>>>> Okay....
>>>>>
>>>>> Suppose I'm not SELECTing on RecID.
>>>>>
>>>>> I'm selecting on other data in the table.
>>>>>
>>>>> How do I get the record ID in that scenario?
>>>>>
>>>> .net/mailman/listinfo/valentina
>>>>
>>>> SELECT *,RecID FROM whereever WHERE whatever ...
>>>
>>> So then, getting the RecID would look like....
>>>
>>> recID = curs.ULongField(?).Value() //????
>>
>> Is the answer to my question "n"? Where n is the last field in all the
>> field found in the SELECT *?
my usage and my way
Dim CurKontoTausch as VCursor
Dim field1, field3 as VString
Dim field2 as VLong
SQLString="select RecID, Konto_Name, Anfangs_Saldo FROM Konten WHERE
Konto_Typ=1 ORDER BY Sortierung, Konto_Name"
CurKontoTausch=meineDatenbank.SQLselect(SQLString, kV_Server,
kV_NoLocks, kV_Random)
Ende=CurKontoTausch.RecordCount
field1=CurKontoTausch.stringfield("RecID")
field2=CurKontoTausch.LongField("Anfangs_Saldo")
field3=CurKontoTausch.stringfield("Konto_Name")
For i=1 to Ende
CurKontoTausch.CurrentPosition=i
ListBox1.addrow field1.value
NeueZeile=ListBox1.LastIndex
ListBox1.cell(NeueZeile,1)=field3.getstring
ListBox1.cell(NeueZeile,2)=format(KontoStandAlt/100,FormatZahlNegativ)
ListBox1.cell(NeueZeile,3)=format(UmrechnungsFaktor,FormatZahlWaehrung)
ListBox1.cell(NeueZeile,4)=format((KontoStandAlt*UmrechnungsFaktor)/
100,FormatZahlNegativ)
ListBox1.cell(NeueZeile,5)=format(KontoStandNeu/100,FormatZahlNegativ)
ListBox1.cell(NeueZeile,6)=format((ListBox1.cell(NeueZeile,4).cdbl-
ListBox1.cell(NeueZeile,5).cdbl),FormatZahlNegativ)
next
but you can also use
Dim RecID as VULong
RecID= CurKontoTausch.ULongfield("RecID")
or faster coding
RecID= CurKontoTausch.ULongfield(1)
bye
Claudius
--
G4/733 QS / MacOS X 10.3.7de / RB 5.5.3de/ Valentina 1.10.0 & 2.0bX
Homepage http://www.ClaSai.de
iChat ryhoruk
RealBasic ListBoxes: [ I feel the need...the need for speed!!! ]
More information about the Valentina
mailing list