Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stored procedures in DW not working with repeating Reg. 1

Status
Not open for further replies.

mfild

Technical User
Nov 1, 2003
22
0
0
GB
Hi,

I am accessing SQL Server 2000 through Dreamweaver. No problems accessing the tables except one big headache. I cannot get a stored procedure to work. I am trying a simple one to see if it worked first. I have created a view and a stored procedure in SQL Server which Dreamweaver will use. In dreamweaver I have placed a form with a recordset that populates a listbox with a submit button below it. In a table further down I have created a repeat region and set the necessary 'show region if not empty' property. The idea is when you select from the list box the associated records should show.

I have followed an exact example in 'Advanced ASP development' by Glasshaus and it worked. I created a separate database for their example and even imported their examples table into my database and it worked ok. It is the repeating records that don't display at all, but there is no error message, its just that they don't appear.

Does anyone have any suggestions.

My procedure in SQL is:

CREATE PROCEDURE spSalesperson(
@spID int)
AS
IF @spID IS NOT NULL
BEGIN
SELECT * FROM viewSalesperson WHERE spID = @spID
END
GO


My view in SQL is:

CREATE VIEW dbo.viewSalesperson
AS
SELECT dbo.tblSalesperson.spID, dbo.tblSalesperson.spTitle, dbo.tblSalesperson.spFirstName, dbo.tblSalesperson.spSurname, dbo.tblSalesperson.spEmail,
dbo.tblCustomer.custID, dbo.tblCustomer.custName
FROM dbo.tblCustomer INNER JOIN
dbo.tblSalesperson ON dbo.tblCustomer.spID = dbo.tblSalesperson.spID


Judging from the example in the book I don't think I am going wrong on the Dreamweaver side of things. If there is something obvious I would appreciate any help as I am new to SQL Server

Many thanks,

Mfild
 
Looks like SP is not receiving @spID parameter.

Try creating simple SP with SQL like:
SELECT * FROM viewSalesperson

without WHERE & parameter and see if it works
 
Oh, forgot to mention Profiler in SQL Server tools - use it to debug SPs.
 
Hi,
Thanks for the help. I traced it back to Dreamweaver not picking up spID.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top