[Gambas-user] metod record count
gunartha.nyoman
gunartha.nyoman at ...1817...
Wed Jan 16 05:17:52 CET 2008
Dear All,
Hi all, could you like to help me.
How to know a table have records or no using result metod
( 'how to know rs have records or no
'when rs have records, show message "?? records found"
'else if no records, show message "no record found" )
PRIVATE FUNCTION kon() AS Boolean
conn = NEW Connection
WITH conn
.Type = "postgresql"
.Host = "localhost"
.Login = "djs"
.Password = "djs"
.Name = "inventory"
END WITH
TRY conn.OPEN
IF ERROR THEN
Message("Cannot open database. Error = " & Error.Text)
RETURN FALSE
END IF
RETURN TRUE
END
PUBLIC SUB Button1_Click()
DIM strsql AS String
DIM rs AS Result
strsql = "select * from goods"
rs = conn.Exec(strsql)
'how to know rs have records or no
'when rs have records, show message "?? records found"
'else if no records, show message "no record found"
END
Thank you for your help
regards
Gunartha
More information about the User
mailing list