Search code examples
vb6recordset

Unspecific behavior of record set in vb6


Dear Expert i have the following problem when i try to get the value from the record set it showing error the query is

SSql = "select doj,dol,employeeid from m_employee where employeeid='" & Trim(RsCardNo!Code) & "'" rsCardRepl.Open SSql, Conn, adOpenDynamic, adLockOptimistic
If rsCardRepl.RecordCount > 0 Then Dim temp As Integer temp = Trim(rsCardRepl!employeeId) rsAddPunch!PAYCODE = temp End If

Then the following line giving the error

temp = Trim(rsCardRepl!employeeId)

The error Number=6 Error Description =Overflow

Would please explain me why this error is coming and what is the solution

Thanks Naval Kishor Pandey


Solution

  • try with cursor type adOpenForwardOnly and lock type adLockReadOnly