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>

Reply via email to