dim intsowid as integer……RecLiumaAnimal.Open "select OtherID from animal where animalid='" & CStr(intsowid) & "'", CnnLiuMaAnimal

解决方案 »

  1.   

    仅有这一条语句无无法判断~~~~,应该是CnnLiuMaAnimal的connectstring写的不对吧
      

  2.   

    整型就不用加 ‘’了吧
    RecLiumaAnimal.Open "select OtherID from animal where animalid=" & intsowid, CnnLiuMaAnimal
      

  3.   

    没看到问题。
    应该是你的CnnLiuMaAnimal有问题。
    Example:Set cn = New ADODB.Connection
      cn.CursorLocation = adUseClient
      m_ConnectionString = _
              "PROVIDER=MSDataShape;Data PROVIDER=" & _
              "Microsoft.Jet.OLEDB.4.0;Data Source=" _
              & App.Path & "\mahasiswa.mdb;"  'If you use database Access not protected by password
      'in the same location with application, you can use this.
      cn.Open m_ConnectionString 
      Set rs = New ADODB.Recordset
      rs.Open "SELECT * FROM t_mhs WHERE NIM=" & "'" & Trim(txtFields(0).Text) & "'", cn  ', adOpenKeyset, adLockOptimistic, adCmdTable'...
    rs.Close
      

  4.   

    RecLiumaAnimal.Open "select OtherID from animal where animalid='" & trim(CStr(intsowid)) & "'", CnnLiuMaAnimal
    改了一下,你在试试。