Free2Code
 
Time: 2008-11-21, 10:16pm
error occurred
Subject: error occurred  ·  Posted: 2006-12-06, 06:05pm
Rank: ? (2)
Member #: 29173
hi ,
i am creating a bank project with sql database, i want that when i enter account number on acc.text then it display detail like name ,date of opening etc. on their txtbox where account no=acc.text.
this is done successfully. when i enter account no it display its detail. but when i enter account no which is not present in table it gives error "either EOF or BOF is true or current record have been deleted this operation requires current record."
while i want that it shows msg "No record exist"

i am writing query
if rs.fields ("accno").value <> acc.text then
msgbox "no record exist"
end if
i have also try variable ano for acc.text
if rs.fields ("accno").value <> ano then
msgbox "no record exist"
end if
i also try move next, move last but it didn't work
please please help me.




 
  Reply to this ·  Post link ·  Top
Subject: Re: error occurred  ·  Posted: 2006-12-07, 03:25am
Rank: ? (4821)
Member #: 3416
i'm guessing your query is only getting the information for the one account number, so when the account number doesn't exist, you get an empty result. you need to check if there are any results, which you can do by seeing if it's at EOF before you've tried to read anything from it, or get a count of how many records get returned by the query.

my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
 
  Reply to this ·  Post link ·  Top
Subject: Re: error occurred  ·  Posted: 2007-03-18, 09:01pm
Rank: ? (2)
Member #: 29576
Check for the record count populated based on the account number. And basec on that display the message accordingly.
You need a check of this sort
If not rs.bof and not rs.eof then
execute this staement.......
End If
Ansuman

www.mindfiresolutions.com


 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

icons