473,326 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Experience the error of rs.BOF or rs.EOF

i have some experience on that thing...some logical error maybe..
coz it works perfectly on different login id that i always use..
i use store procedure and maybe it got some error in it..
please let me know if it have some
here the select for record that make me got error either bof or eof true or either record has been deleted...like that
Expand|Select|Wrap|Line Numbers
  1. set ANSI_NULLS ON
  2. set QUOTED_IDENTIFIER ON
  3. go
  4.  
  5.  
  6. ALTER procedure [dbo].[select_Peribadi]
  7. (
  8. @Personel_No varchar(8),
  9. @typesp int
  10. )
  11. as
  12. /*DECLARE @myERROR int -- Local @@ERROR
  13.        , @myRowCount int -- Local @@ROWCOUNT*/
  14. SET NOCOUNT ON
  15. if (@typesp='1')
  16. begin
  17. SELECT     tblperibadi.Personel_No,tblPeribadi.Nama,tblCompany.Keterangan as Company_Code, tblPeribadi.Jawatan, tblPeribadi.Taraf_Jawatan, 
  18.                       tblGroup.Keterangan AS Kumpulan,tblPeribadi.Gred,tblBusiness_Area.Keterangan AS Business_Area,tblCost_Center.Keterangan AS Kod_Pusat_Kos,  tblPeribadi.IC_Baru, tblPeribadi.IC_Lama, 
  19.                       tblPeribadi.Jantina, tblPeribadi.BumiStatus, 
  20.     CAST(DAY(tblPeribadi.Tarikh_Lahir) AS VARCHAR(2)) + ' ' + DATENAME(MM, tblPeribadi.Tarikh_Lahir) + ' ' + CAST(YEAR(tblPeribadi.Tarikh_Lahir) AS VARCHAR(4)) AS [Tarikh_Lahir],
  21.                       tblPeribadi.Tempat_Lahir,TblCountry.CDesc as Negara_Kelahiran,  tblstate.Statedesc as Negeri_Kelahiran, 
  22.                       tblMaritulStatus.MarStat as Taraf_Perkahwinan, 
  23.     CAST(DAY(tblPeribadi.Tarikh_Perkahwinan) AS VARCHAR(2)) + ' ' + DATENAME(MM,tblPeribadi.Tarikh_Perkahwinan) + ' ' + CAST(YEAR(tblPeribadi.Tarikh_Perkahwinan) AS VARCHAR(4)) AS [Tarikh_Perkahwinan],
  24.                       tblreligious.Rel_Denomination as Agama, tblEthnic.EthnicDesc as Bangsa, tblPeribadi.No_EPF, tblPeribadi.No_Socso, 
  25.                       tblPeribadi.No_Tax, tblPeribadi.Email  
  26. FROM         tblPeribadi INNER JOIN
  27.                       tblCompany ON tblPeribadi.Company_Code=tblCompany.Company_Code INNER JOIN
  28.                       tblGroup ON tblPeribadi.Kumpulan = tblGroup.Kumpulan INNER JOIN
  29.                       tblBusiness_Area ON tblPeribadi.Business_Area = tblBusiness_Area.Business_Area INNER JOIN
  30.                       tblCost_Center ON tblPeribadi.Kod_Pusat_kos = tblCost_Center.Kod_Pusat_Kos LEFT JOIN
  31.                       TblCountry ON tblPeribadi.Negara_Kelahiran = TblCountry.CShort LEFT join 
  32. tblstate on tblPeribadi.Negeri_Kelahiran=tblstate.region LEFT join 
  33. tblMaritulStatus on tblPeribadi.Taraf_Perkahwinan=tblMaritulStatus.MarCode LEFT join
  34. tblreligious on tblPeribadi.Agama=tblreligious.relcode LEFT join 
  35. tblethnic on tblPeribadi.Bangsa=tblEthnic.EthnicCode
  36. where tblperibadi.Personel_No=@Personel_No
  37. /*SELECT @myERROR = @@ERROR, @myRowCount = @@ROWCOUNT
  38.     IF @myERROR != 0 GOTO HANDLE_ERROR*/
  39. end
  40.  
  41. if (@typesp='2')
  42. begin
  43. SELECT     tblPeribadi.Personel_No, tblPeribadi.Nama,tblCompany.Keterangan as Company_Code, tblPeribadi.Jawatan, tblPeribadi.Taraf_Jawatan, 
  44.                       tblGroup.Keterangan AS Kumpulan,tblPeribadi.Gred,tblBusiness_Area.Keterangan AS Business_Area,tblCost_Center.Keterangan AS Kod_Pusat_Kos,  tblPeribadi.IC_Baru, tblPeribadi.IC_Lama, 
  45.                       tblPeribadi.Jantina, tblPeribadi.BumiStatus,
  46.     CAST(DAY(tblPeribadi.Tarikh_Lahir) AS VARCHAR(2)) + ' ' + DATENAME(MM, tblPeribadi.Tarikh_Lahir) + ' ' + CAST(YEAR(tblPeribadi.Tarikh_Lahir) AS VARCHAR(4)) AS [Tarikh_Lahir], 
  47.                       tblPeribadi.Tempat_Lahir,tblPeribadi.Negara_Kelahiran,  tblPeribadi.Negeri_Kelahiran, 
  48.                       tblPeribadi.Taraf_Perkahwinan,
  49.     CAST(DAY(tblPeribadi.Tarikh_Perkahwinan) AS VARCHAR(2)) + ' ' + DATENAME(MM,tblPeribadi.Tarikh_Perkahwinan) + ' ' + CAST(YEAR(tblPeribadi.Tarikh_Perkahwinan) AS VARCHAR(4)) AS [Tarikh_Perkahwinan],
  50.                       tblPeribadi.Agama, tblPeribadi.Bangsa, tblPeribadi.No_EPF, tblPeribadi.No_Socso, 
  51.                       tblPeribadi.No_Tax, tblPeribadi.Email  
  52. FROM         tblPeribadi INNER JOIN
  53.                       tblCompany ON tblPeribadi.Company_Code=tblCompany.Company_Code INNER JOIN
  54.                       tblGroup ON tblPeribadi.Kumpulan = tblGroup.Kumpulan INNER JOIN
  55.                       tblBusiness_Area ON tblPeribadi.Business_Area = tblBusiness_Area.Business_Area INNER JOIN
  56.                       tblCost_Center ON tblPeribadi.Kod_Pusat_kos = tblCost_Center.Kod_Pusat_Kos       
  57. where tblperibadi.personel_no=@Personel_No
  58. end
  59. /*COMMIT TRAN
  60.  
  61. HANDLE_ERROR:
  62.     ROLLBACK TRAN
  63.     RETURN @myERROR*/
  64. /*Done by Rahmat*/
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
and some other to check login
Expand|Select|Wrap|Line Numbers
  1. set ANSI_NULLS ON
  2. set QUOTED_IDENTIFIER ON
  3. go
  4.  
  5.  
  6.  
  7. ALTER PROCEDURE [dbo].[get_user]
  8. (    
  9.     @user_id varchar(8),
  10.     @pwd varchar(12),
  11.     @level char(1) OUTPUT
  12. )
  13. AS
  14.  
  15. IF EXISTS(SELECT Personel_No From TblUser_ID where Personel_No = @user_id)
  16.     BEGIN
  17.     IF EXISTS(SELECT Personel_No From TblUser_ID where Personel_No = @user_id AND Password = @pwd)
  18.         BEGIN
  19.             SET @level=(SELECT Levels FROM tblUser_ID WHERE Personel_No = @user_id AND Password = @pwd)
  20.             INSERT INTO TblAudit_Trails(Personel_No,IC_Baru,Business_Area) 
  21.                 SELECT Personel_No,IC_Baru,Business_Area 
  22.                 From TblPeribadi 
  23.                 where Personel_No = @user_id AND IC_Baru = @pwd
  24.             IF EXISTS(SELECT IC_Baru From TblPeribadi where Personel_No = @user_id AND IC_Baru = @pwd)
  25.                 BEGIN
  26.                 RETURN(4)
  27.                 END
  28.             ELSE
  29.                 RETURN(3)
  30.         END
  31.     ELSE
  32.         SET @level='0'
  33.         RETURN(1)
  34.     END
  35. ELSE
  36.     BEGIN
  37.     IF EXISTS(SELECT Personel_No From TblPeribadi where Personel_No = @user_id)
  38.         BEGIN
  39.         IF EXISTS(SELECT Personel_No From TblPeribadi where Personel_No = @user_id AND IC_Baru = @pwd)
  40.             BEGIN
  41.                 INSERT INTO TblUser_ID(Personel_No,Password,Update_By) 
  42.                     VALUES(@user_id,@pwd,@user_id)
  43.                 INSERT INTO TblAudit_Trails(Personel_No,IC_Baru,Business_Area) 
  44.                     SELECT Personel_No,IC_Baru,Business_Area 
  45.                     From TblPeribadi 
  46.                     where Personel_No = @user_id AND IC_Baru = @pwd
  47.                 SET @level='4'
  48.                 RETURN(4)
  49.             END
  50.         ELSE
  51.             SET @level='0'
  52.             RETURN(2)
  53.         END
  54.     ELSE
  55.         SET @level='0'
  56.         RETURN(0)
  57.     END
  58.  
  59. /*Done by Rahmat*/
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
Nov 14 '08 #1
2 2877
jhardman
3,406 Expert 2GB
I recently had an error where the login I was using did not have access tot he stored procedures - if I copied the code for the proc to the query I was passing (even though it was excessively long) it worked. Try that and let me know if it helps.

Jared
Nov 20 '08 #2
I recently had an error where the login I was using did not have access tot he stored procedures - if I copied the code for the proc to the query I was passing (even though it was excessively long) it worked. Try that and let me know if it helps.

Jared
actually this error was cause by the data on table which make the record is not selected ....
tblPeribadi column that using inner join got the data of null or not match with column on other table for inner join...
anyway i want to share all my experience of getting error and debug it to all
Hopefully there's solution for everyone
Nov 21 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: scrunchy2k | last post by:
Hi, I have noticed that some PHP based webpages have a similar look. For instance, text within non-overlapping, non-touching rectangles which are nicely laid out on a page. Is there some...
3
by: John J. Walton | last post by:
Hi ! I wonder if anyone can give me some advice. I have been in IT for 30 yrs. Most of the time I have coded in Cobol on medium size systems (Data General, now a dinosaur). For the past 2 years...
10
by: jrefactors | last post by:
In the interview, when interviewers ask how much experience you have in C/C++. Do they mean work experience in C/C++, or programming experience in C/C++? Do they consider college projects as...
0
by: Francesco Di Cerbo | last post by:
Hello, we are calling for Experience Report for OSS 2005, The First International Conference on Open Source Systems. It's a chance for OSS developers to meet industrial and government needs, and...
8
by: Lauren Wilson | last post by:
I'd like to hear from anyone who has used any of the products from FMS at www.fmsinc.com. Just curious about your experience with these products.
40
by: Visionary | last post by:
Greetings, I'm the webmaster/team lead at avlabsdesign.com, and I'm currently on the hunt for a PHP programmer to join the team. I've been spreading myself quite thin lately, and aside from that...
111
by: Enteng | last post by:
Hi I'm thinking about learning C as my first programming language. Would you recommend it? Also how do you suggest that I learn it?What books/tutorials should I read for someone like me? Thanks...
0
by: David_Parkes | last post by:
A global leader in the digital media space based in the Dallas/Fort Worth Metroplex – is currently re-architecting its core product line and is doing so on the back of Microsoft .NET 3.0/3.5 and...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.