有没有跟踪过?gADORst!id是不是NULL?

解决方案 »

  1.   

    select max(id) as id  from table
      

  2.   

    答复:阿甘(努力努力再努力的阿甘.Net)  在表中id字段是用值的,不会为空
    答复: charise(www.51mis.com)     用select max(id) as id  from table
    会出现:id循环引用还是不能解决问题
      

  3.   

    答复:阿甘(努力努力再努力的阿甘.Net)  在表中id字段是有值的,不会为空
      

  4.   

    我同意: charise(www.51mis.com) 的意见,用max后,你若没指定as语句,字段名是会为的。
      

  5.   

    在以上的代码第几行出错了,
    if 第二行
       如果是把table改成  [table] 试试
    else
       把id 都换成 [id]试试
    end if
      

  6.   

    你把as后面的换个名称试试,比如 as tid?
      

  7.   

    select max(id) as max_id from ...
    text1.text=gADORst!max_id
      

  8.   

    select max(table.id) as id  from table
    这样写可避免发生id循环引用的错误。
      

  9.   

    sSql = "select max(id) as id from table"
      

  10.   

    Text1.Text =gADORst.filed(0).value
      

  11.   

    sSql = "select max(id) as maxid from table"
       gADORst.Open sSql, gADOCnMain, adOpenStatic, adLockReadOnly, adCmdText
        Text1.Text = gADORst!maxid