New topic: 

Filling Web List box, only get a single record.

<http://forums.realsoftware.com/viewtopic.php?t=37720>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        tseyfarth          Post subject: Filling Web List box, only get 
a single record.Posted: Fri Feb 18, 2011 6:53 pm                         
Joined: Sat Dec 04, 2010 9:14 pm
Posts: 90                Hello all.

I am trying to fill a list box with all records available from a given DB.  
Using Postgre tools, I know there are 3 records in the database.  However each 
time I try, I only get the last record, never all three showing up in the list 
box.

Here is the code:

This code calls the class Method from within a Form Method
Code:  remotes.Module_Type_No = 4 'Access
  Result = remotes.GetEqualKey6
 

This is the code within the class Methods
Code:  dim osql as new cSmartSQL
  Dim ssql as String
  Dim msg as String
  
  Dim sMod_typeNo as String
  RecordCount = 0
  
  sMod_typeNo = cstr(Module_Type_No)
  
  
  osql.StatementType = eStatementType.Type_Select
  osql.AddTable"remotes"
  osqL.AddFieldS 
"address","slot","module_type_no","module_device_no","module_type_name","remote_name","priority","relay_slot","relay_no","slave","maddress","mslot","mtype","mmodule_device_no","commformat","disable_tamper","commfailure","function","relay_on_time"
  
  osql.ClearWhereClause
  osql.AddSimpleWhereClause "module_type_no", smod_typeNo,"remotes"  ', 
eClauseOp.Equal
  msg = osql.SQL
  RsRemotes = db.SQLSelect(osql.SQL)
  
  if db.Error = true then
  dbMessage = db.ErrorMessage
  Return db.ErrorCode
  end if
  'RsRemotes.Field("remote_type" not used yet
  
  RecordCount = 0
  dbMessage= db.ErrorMessage
  
  RsRemotes.MoveFirst
  while Not RsRemotes.EOF
  RecordCount = RecordCount +1
  RsRemotes.MoveNext
  wend
  
  Return db.ErrorCode
  


WebListbox Code
Code:  RsRemotes.MoveFirst
  do until RsRemotes.EOF
  Remotes.address = RsRemotes.Field("address").IntegerValue
  Remotes.Remote_Name=RsRemotes.Field("remote_name").StringValue
  Remotes.Priority=RsRemotes.Field("priority").IntegerValue
  Remotes.Slave=RsRemotes.Field("slave").IntegerValue
  Remotes.MasterAddress=RsRemotes.Field("maddress").IntegerValue
  Remotes.MasterSlot=RsRemotes.Field("mslot").IntegerValue
  Remotes.MasterType=RsRemotes.Field("mtype").IntegerValue
  Remotes.CommFormat=RsRemotes.Field("commformat").IntegerValue
  Remotes.Tamper_Disabled=RsRemotes.Field("disable_tamper").IntegerValue
  
  Remotes.Funct= RsRemotes.Field("function").StringValue
  Remotes.Relay_OnTime= RsRemotes.Field("relay_on_time").IntegerValue
  'Fun= RsRemotes.Field("function").StringValue
  OnTime= Cstr(RsRemotes.Field("relay_on_time").IntegerValue)
  
  Slave = "No"
  if Remotes.Slave = 1 then Slave ="Yes"
  Tamper = "No"
  If Remotes.Tamper_Disabled =  1 then Tamper = "Yes"
  lstAccessControls.AddRow Cstr(Remotes.Address),Remotes.Remote_Name,Fun, 
OnTime, Cstr(Remotes.Priority),Cstr(Remotes.CommFormat),Tamper 
,Cstr(Remotes.MasterAddress),Cstr(Remotes.MasterSlot),Cstr(Remotes.MasterType)
  RsRemotes.MoveNext
  loop
  


Can anyone tell me where I've messed up?  It seems also, the debugger crashes 
(windows reports this) while stepping through the Form Method where the 
WebListBox code resides.

Thank you
Tim   
                             Top            Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to