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
该消息显示“有多个项目具有此名称,但不清楚该调用指的是哪一项 lSupervisorTotal = r.IdxField(0)”
以上是整个方法,我不知道错误在说什么。
最佳答案
应该是r.IdxField(0).integervalue。如果是字符串,则为 r.IdxField(0).stringvalue、日期的 .datevalue 等。
更多信息可以在在线文档中找到:http://docs.realsoftware.com/index.php/RecordSet.IdxField
关于mysql - REALBasic 和 MySQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6525136/