That's an idea as the older Rapid-Q Basic that I use to use, I did just that
so when anyone would create a new record it just wrote over the same one
over and over again.
Good idea :)
Thanks
Jonathon
----- Original Message -----
From: "Trausti Thor Johannsson" <[EMAIL PROTECTED]>
To: "REALbasic NUG" <[email protected]>
Sent: Tuesday, October 03, 2006 2:21 PM
Subject: Re: How to limit RSBBase record to 1?
what about this extremely simple sql command.
rs = app.patientdb.sqlselect("select * from medications limit 1")
Always returns 1 record, no matter what. Also, in your demo version, you
can code it so that every time you write data, you write to id=1.
Just an idea.
Trausti
On Oct 3, 2006, at 2:37 AM, <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]> wrote:
Hello all,
It's been some time since I was last on here. I have a question as to
how to limit the records entered into a RealBasicSQLDatabase?
Here is what I have so far. I added the [ elseif rs.RecordCount > 1
then ] to the code below as the rest works ok.
dim rs as RecordSet
// Select the Maximum Value of the LineItemID column in the LineItems
Table
rs = App.PatientDB.SQLSelect("SELECT MAX(LineItemID) FROM
Medications")
// If there aren't any rows in the table, just return 1 as the first
value to use
if rs = nil or rs.EOF then
return 1
elseif rs.RecordCount > 1 then
MsgBox"This version is limited to only 1 entry."
return 0
end if
// Return the Integer one greater than the maximum for the new ID
return rs.IdxField(1).IntegerValue + 1
Any help?
JonathonNo virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.407 / Virus Database: 268.12.11/460 - Release Date:
10/1/2006
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.407 / Virus Database: 268.12.12/461 - Release Date: 10/2/2006
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.407 / Virus Database: 268.12.12/461 - Release Date: 10/2/2006
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>