Access Stored Procedure Problem

S

Savas Ates

my stored procedure in access XP (I create it Succesfully)
It returns me all records.. For example in my db there are records with
catid=1 but no record with id=2

I try my code both catid=1 and catid=2 it returns same records.. What is my
fault..?

CREATE PROCEDURE ST_GETSUBCAT
(
@CatID

Integer
)
AS

SELECT * FROM TBLCATSUB WHERE catid=@CatID


Ssql="EXEC ST_GETSUBCAT 1"
set rs=baglantim.execute(Ssql)
do while not rs.eof
Response.Write rs("id") & "<br>"

rs.movenext
loop
 
S

Sylvain Lafontaine

For SQL-Server, it's "int", not "integer". You should also make a direct
call to the ST_GETSUBCAT stored procedure by using the command object and
its parameters collection instead of using an EXEC call. With the later,
you will have many problems with things like date, currency, string with
embedded single and double quote, GUID, etc.

You can also have a caching problem; as when you are seeing an old result
from an old request to the ASP page. You should print the time somewhere on
the page to make sure that it have been refreshed. Caching problems are
very common with ASP and ASP.NET when the expiration properties for the page
or the repertory are not correctly set on the IIS.

S. L.
 
S

Sylvain Lafontaine

Oh, I'm sorry but obviously I've made a mistake in my previous post: "int"
and "integer" are both valid on SQL-Server. With all these languages, it's
easy to get confused sometimes.

S. L.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top