Forums
This topic is locked
Get first record in table
23 Jul 2001 11:58:22 Bec C posted:
Through the Ultradev recordset creation box how do I filter the first record in a database table?Can I use the FETCH command in the query? If so how do I interspere this:
FETCH FIRST FROM myTable
I can't filter via the autonumber ID field as records are constantly being deleted so there might not actually be a record with an ID of 1 so I need to get the first row of the database table!
Also I am aware that UD sets the cursor type with a numerical value. Is there a list of what these values equal e.g. dynamic cursor, read only etc etc.
Thanks
Replies
Replied 23 Jul 2001 17:02:42
23 Jul 2001 17:02:42 Joel Martinez replied:
you should be able to use the <pre id=code><font face=courier size=2 id=code>min(ID)</font id=code></pre id=code> function to get the smallest ID field...
as far as the numerical values, you can look in an ADOVBS.inc file for the numerical values of dynamic cursor, read only, etc... then figure it out that way...
you can get one at:
www.4guysfromrolla.com/adovbs.inc
(update: I found the constants, may as well postem)<pre id=code><font face=courier size=2 id=code>'---- CursorTypeEnum Values ----
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3
</font id=code></pre id=code>
Joel Martinez
----------
Is this thing on?....
Edited by - joelmartinez on 07/23/2001 17:05:55
as far as the numerical values, you can look in an ADOVBS.inc file for the numerical values of dynamic cursor, read only, etc... then figure it out that way...
you can get one at:
www.4guysfromrolla.com/adovbs.inc
(update: I found the constants, may as well postem)<pre id=code><font face=courier size=2 id=code>'---- CursorTypeEnum Values ----
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3
</font id=code></pre id=code>
Joel Martinez
----------
Is this thing on?....
Edited by - joelmartinez on 07/23/2001 17:05:55
Replied 29 Jul 2001 05:49:54
29 Jul 2001 05:49:54 I Mahomed replied:
try this simple sql <img src=../images/dmxzone/forum/icon_smile_tongue.gif border=0 align=middle>
Select First(FieldName) From TableName Where FieldName = 'blah'
Laterz
Disorder
Edited by - Disorder on 07/29/2001 05:53:55
Select First(FieldName) From TableName Where FieldName = 'blah'
Laterz
Disorder
Edited by - Disorder on 07/29/2001 05:53:55
Replied 29 Jul 2001 12:37:41
29 Jul 2001 12:37:41 Bruno Mairlot replied:
You may also try this (for MySQL)
select name,blabla FROM tablename LIMIT 1
"First they laugh at you, then they fight you, then you Win..." Ghandi
select name,blabla FROM tablename LIMIT 1
"First they laugh at you, then they fight you, then you Win..." Ghandi