id什么类型?
如果是数字行,请
strSQL = "Select * from mains where id=" & bbbsid   

解决方案 »

  1.   

    源代码:
    bbbsid=Request.QueryString("bbsid")set mc= Server.CreateObject("ADODB.Connection")
    mc.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath("bbsdb.mdb")
    set rs = Server.CreateObject("ADODB.Recordset")
    strSQL = "Select * from mains where id='" & bbbsid & "' "
    rs.open strsql,mc 错误:
    错误类型:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
    /lhd/one.asp, 第 28 行第 28 行为:
    rs.open strsql,mc 
    当把第27行换成:
    strSQL = "Select * from mains where c_id='" & bbbsid & "' "  
    可行!
      

  2.   

    同意 Rewiah(乘长风)  
     
    改成  strSQL = "Select * from mains where id=" & bbbsid   
    应该就对了!
     
     
      

  3.   

    很不幸!
    Rewiah(乘长风)  的方法不行!
    感谢!
      

  4.   

    确认自动编号字段的字段名是“ID”,不要对自动编号字段进行修改(Update),插入数据时也不要显式地指定字段值。
      

  5.   

    Rewiah(乘长风)  的方法不行!
    只有一个可能,你的bbbsid不是数字,你这么判断一下:
    if not (bbbsid is nothing ) then
      if isnumeric(bbbsid) then
          strSQL = "Select * from mains where id=" & bbbsid   
       else
          '出错处理
       endif
    else
       '出错处理
    endif
      

  6.   

    试一试:
    "SELECT * FROM [mains] WHERE id LIKE '" & bbbsid & "'"