2
Dim db as MySQLCommunityServer
  db  =New MySQLCommunityServer
  db.host="127.0.0.1"
  db.port=3306
  db.databaseName="requesterdb"
  db.userName="root"
  db.Password=""

  Dim divisionID As String
  Dim supervisorName As String
  Dim lsupervisorTotal As Integer

  If db.Connect then


    dim r as RecordSet
    r=db.SQLSelect("select COUNT(*) As supervisorTotal FROM supervisorTable WHERE supervisorName='" + SupervisorTextField.Text.Trim + "'")

    if r<>nil and r.RecordCount>0 then
      while not r.EOF
        lsupervisorTotal     = r.IdxField(0) // Line with Error
        If lsupervisorTotal > 0 Then
          ' Check User Database and Insert If Needed
        End If

        r.MoveNext
      wend
    end if


  else
    MsgBox "Connection failed!"
  end if

  db.Close

The message says "There are several items with this name and it's not clear which one the call refers to lSupervisorTotal = r.IdxField(0)"

Above is the entire method and I don't know what the error is talking about.

Brad
  • 159,648
  • 54
  • 349
  • 530
Cocoa Dev
  • 9,361
  • 31
  • 109
  • 177

1 Answers1

6

It should be r.IdxField(0).integervalue. If it was a string it would be r.IdxField(0).stringvalue, .datevalue for a date, etc.

More info can be found in the online documentation at http://docs.realsoftware.com/index.php/RecordSet.IdxField

BKeeney Software
  • 1,299
  • 6
  • 8
  • I upvoted this answer, though I would assume the code in the original post wouldn't correctly compile because it would expect an integer, whereas .IdxField would just return a database field. – mjdth Jul 04 '11 at 23:17