<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=174583608-06092002><FONT face=Arial color=#0000ff size=2>i
shall try this. i must say i'm very impressed at the help i've received so far
on my queries. </FONT></SPAN></DIV>
<DIV><SPAN class=174583608-06092002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=174583608-06092002><FONT face=Arial color=#0000ff
size=2>Trevor, the reason i've filled the my message outwith the if statement
was just to check the sql was actually finding a record. </FONT></SPAN></DIV>
<DIV><SPAN class=174583608-06092002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=174583608-06092002><FONT face=Arial color=#0000ff size=2>I
recollect an older version of VB where you had to go to the bof and eof to get
the recordcount to work. But certainly in vb 6 you just use recordcount. Maybe
something for future version of rev?</FONT></SPAN></DIV>
<DIV><SPAN class=174583608-06092002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV></DIV>
<DIV><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Tuviah
Snyder [mailto:tuviah@runrev.com] <BR><B>Sent:</B> 05 September 2002
18:48<BR><B>To:</B> use-revolution@lists.runrev.com<BR><B>Subject:</B> RE: Using
a database cursor<BR><BR></DIV></FONT>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial size=2>
<DIV><BR>> put "SELECT * FROM tblName WHERE tblName.Login = '" &
field "login" & "'"<BR>>into strSql<BR>> get
revdb_query(field "dbID",strSql)<BR>> put "Welcome " &
revdb_columnbyname(it,"fname") into field "MyMessage"<BR>>
<BR>> if revdb_recordcount(it) <= 0 then<BR>>
put "Sorry, no login for " & field "login" & " in the
database"<BR>> else<BR>> put "Welcome " &
revdb_columnbyname(it,"fname") into field "MyMessage"<BR>> end
if<BR>></DIV>
<DIV>revdb_recordcount returns -1 for some databases (particularly MS Access),
this is a bug in the database itself. A workaround is
to fetch all the rows in the resultset until eof. RevDB does not do
this because it could be very expensive for huge resultsets.</DIV>
<DIV> </DIV>
<DIV>repeat while revdb_iseof(tcursor) is true</DIV>
<DIV> add 1 to recordcount</DIV>
<DIV>end repeat</DIV>
<DIV> </DIV>
<DIV>Below find a modified script</DIV>
<DIV> </DIV>
<DIV>put "SELECT * FROM tblName WHERE tblName.Login = '" & field "login"
& "'" into strSql<BR>get revdb_query(field "dbID",strSql)<BR>put
"Welcome " & revdb_columnbyname(it,"fname") into field "MyMessage"<BR>if
revdb_iseof(it) is true then</DIV>
<DIV>put "Sorry, no login for " & field "login" & " in the database"
#first record is eof..resultset is empty </DIV>
<DIV> else</DIV>
<DIV> put "Welcome " & revdb_columnbyname(it,"fname") into field
"MyMessage"</DIV>
<DIV> end if<BR></DIV>
<DIV>Tuviah Snyder <<A
href="mailto:tuviah@runrev.com">tuviah@runrev.com</A>> <<A
href="http://www.runrev.com/">http://www.runrev.com/</A>><BR>Runtime
Revolution Limited - The Solution for Software
Development</DIV></BLOCKQUOTE></FONT></BODY></HTML>