vb6 - recordset.close got wrong help plssss -


help code got wrong says:

either bof or eof true, or current record has been deleted,requested operation requires current record.

i think rs.close has problem or can set rs.close? because set , used recordset twice. can help? please fix code.



public function borrowersname(byval iname, byval imod, byval icat, byref bfname, byref blname) boolean 

dim datereturned string

'select firt primary key of item qry1 = "select tblitem_id tblitem inner join tblcategory on tblitem.tblcategory_id=tblcategory.tblcategory_id tblitem.item_name='" + iname + "' , tblitem.item_model='" + imod + "' , tblcategory.category_name='" + icat + "'" rs.open qry1, conn qry1result = rs.fields(0).value rs.close  qry2 = "select date_returned,firstname,lastname tblborrowers tblitem_id='" & qry1result & "' order tblborrowers_id desc limit 1" rs.open qry2, conn  datereturned = rs.fields(0).value  if datereturned <> ""   borrowersname = true   bfname = rs.fields(1).value   blname = rs.fields(2).value else   borrowersname = false end if  set rs = nothing 

end function

you have recordset open , close methods in right order, there no problem there.

the error "either bof or eof true, or current record has been deleted" means 1 of select queries has returned 0 records. depends on requirements. example, test not rs.eof before attempting read field value.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -