Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Stored Procedure? Error Checking?

LEGEND ,
Jan 15, 2008 Jan 15, 2008

Copy link to clipboard

Copied

I'm getting

(Either BOF or EOF is True, or the current record has been deleted.)

on the page and I'm thinking it's because the SP errors because a part
of the requested items are empty. The page works until I add the items
after the *****'s . Without those, it works fine.

First of all, should I do error checking in the SP, second, how? Or, is
there somewhere else I should look? The first error that I get happens
when I do a file check to see if an Image actually exists on the server

line that first error pops up-------<% strFilename =
"e:\path\to\site\Pix\DD" & (recordset.Fields.Item("ProductID").Value) &
".jpg"
If (fs.FileExists(strFilename))=true Then %>----------------end of
error line

CREATE PROCEDURE spname
@variable1 varchar (20)

AS
SELECT P.ID AS ProductID, P.Name, P.ProdID, P.Price, P.ShipCost,
P.ClearSale, P.SalePrice, P.new, PC.gid AS PCgid, G.gid, G.pid AS Gpid,
G.ord, D.PID AS DPID, D.Paragraph

*******, AIG.copyright, AIG.itemsize, AIG.cartdate, AIG.grade,
AIG.specialNotice, AIG.warning, AIG.videoLength, AIG.keywords,
AIG.dateadded, AIG.bestseller

FROM atblProducts P
INNER JOIN Groups G ON P.ID = G.pid
INNER JOIN PCat PC ON G.gid = PC.gid

*******INNER JOIN atblAddInfoGroup AIG ON P.ID = AIG.addInfoID

LEFT JOIN Description D ON G.pid = D.PID
WHERE P.ProdID = @variable1 AND P.price IS NOT NULL AND P.Price <> 0
GO
TOPICS
Server side applications

Views

334
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 15, 2008 Jan 15, 2008

Copy link to clipboard

Copied

OK< I figured out the error, I should have put an inner join

HOWEVER, I am curious how to do typical error checking that we might
find in a SP?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 15, 2008 Jan 15, 2008

Copy link to clipboard

Copied

You are getting the error because the recordset you are attempting to return
is empty. This is an ASP error and is not being generated from SQL Server.

If I were you I would execute your SP through query analyzer and if the
resulting data set is empty then this is why you are receiving the error on
your ASP page.

For your info:- if there was an error with your SQL code then you would be
getting a completely different error than this.


"Art" <lee_nospamification@artjunky.com> wrote in message
news:fmisq3$2b0$1@forums.macromedia.com...
> I'm getting
>
> (Either BOF or EOF is True, or the current record has been deleted.)
>
> on the page and I'm thinking it's because the SP errors because a part of
> the requested items are empty. The page works until I add the items after
> the *****'s . Without those, it works fine.
>
> First of all, should I do error checking in the SP, second, how? Or, is
> there somewhere else I should look? The first error that I get happens
> when I do a file check to see if an Image actually exists on the server
>
> line that first error pops up-------<% strFilename =
> "e:\path\to\site\Pix\DD" & (recordset.Fields.Item("ProductID").Value) &
> ".jpg"
> If (fs.FileExists(strFilename))=true Then %>----------------end of error
> line
>
> CREATE PROCEDURE spname
> @variable1 varchar (20)
>
> AS
> SELECT P.ID AS ProductID, P.Name, P.ProdID, P.Price, P.ShipCost,
> P.ClearSale, P.SalePrice, P.new, PC.gid AS PCgid, G.gid, G.pid AS Gpid,
> G.ord, D.PID AS DPID, D.Paragraph
>
> *******, AIG.copyright, AIG.itemsize, AIG.cartdate, AIG.grade,
> AIG.specialNotice, AIG.warning, AIG.videoLength, AIG.keywords,
> AIG.dateadded, AIG.bestseller
>
> FROM atblProducts P
> INNER JOIN Groups G ON P.ID = G.pid
> INNER JOIN PCat PC ON G.gid = PC.gid
>
> *******INNER JOIN atblAddInfoGroup AIG ON P.ID = AIG.addInfoID
>
> LEFT JOIN Description D ON G.pid = D.PID
> WHERE P.ProdID = @variable1 AND P.price IS NOT NULL AND P.Price <> 0
> GO


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 15, 2008 Jan 15, 2008

Copy link to clipboard

Copied

Look in Books Online for @@ERROR. Books Online is a great SQL Server
resource.


"Art" <lee_nospamification@artjunky.com> wrote in message
news:fmivga$59t$1@forums.macromedia.com...
> OK< I figured out the error, I should have put an inner join
>
> HOWEVER, I am curious how to do typical error checking that we might find
> in a SP?


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 15, 2008 Jan 15, 2008

Copy link to clipboard

Copied

@@ERROR ?


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 15, 2008 Jan 15, 2008

Copy link to clipboard

Copied

LATEST
I now realize that I didn't mean that I wanted to catch "errors."

Instead, I think what I want is to be able to check if something is true
or not inside of a SP.

For example, I have a page that takes a poll of how people found us. On
the next page it adds the person's choice to the SQL database when they
arrive. However, If someone comes into this page without going through
the same door, they'll get an error that I think is generated by SQL
because there are no values being passed. So, I imagine having some sort
of if statement in the sql that checks if there is a variable and if
there is, it add to the database and if not, it gets ignored.

So, in this case, is it best to have SQL check this or just deal with it
on the page using ASP?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines