首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >REALBasic和MySQL

REALBasic和MySQL
EN

Stack Overflow用户
提问于 2011-06-30 01:58:13
回答 1查看 1K关注 0票数 2
代码语言:javascript
复制
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)”。

上面是整个方法,我不知道这个错误在说什么。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-06-30 02:15:19

它应该是r.IdxField(0).integervalue。如果是字符串,则为r.IdxField(0).stringvalue,日期为.datevalue,依此类推。

有关更多信息,请参阅http://docs.realsoftware.com/index.php/RecordSet.IdxField的在线文档

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6525136

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档