REALBasic 和 MySQL
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)”
上面是整个方法,我不知道错误在说什么。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它应该是 r.IdxField(0).integervalue。如果是字符串,则为 r.IdxField(0).stringvalue、日期的 .datevalue 等。
更多信息可以在在线文档中找到,网址为 http://docs.realsoftware.com/index.php/RecordSet.IdxField
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