If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Need advise with stored proc + ASP issue.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-14-03, 00:11
fused fused is offline
Registered User
 
Join Date: May 2003
Posts: 23
Need advise with stored proc + ASP issue.

Wrote a simple stored proc to list out names which have one param to see whether is it a full listing or whether is it based on alphabetical

Code:
CREATE PROCEDURE usr_listcontractors(@sortby varchar(2))
as
If @sortby ='fl'
select *  from contractor where deleted ='N' order by 'CName' 
else
select * from contractor where cname like @sortby+"%" and deleted ='n' order by 'CName'
GO
The above works fine in query analyser (exec usr_listcontractors)

Under my ASP page,

Code:
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString=mstrConnectionString 
objConn.open
strcontractors= "usr_listcontractors fl"
Set objRS= Server.CreateObject("ADODB.Recordset")
objRS.Open strcontractors,objConn,1,3
	objRS.PageSize = 15		
	objRS.CacheSize = objRS.PageSize
	intPageCount = objRS.PageCount 
	intRecordCount = objRS.RecordCount 
.
.
.
The above is supposed to show up the full listing of contractors. But nothing shows up on the ASP page.

But if i were to execute "usr_listcontractors fl" in query analyser, the result displays promptly.

What am I missing out? Please advise. I believe the issue is with the ASP scripts.

Thanks.
Reply With Quote
  #2 (permalink)  
Old 09-14-03, 19:39
bill_dev bill_dev is offline
Registered User
 
Join Date: Sep 2003
Posts: 60
Re: Need advise with stored proc + ASP issue.

Looks like fl needs to be in quotes:
Code:
strcontractors= "usr_listcontractors 'fl' "
Reply With Quote
  #3 (permalink)  
Old 09-23-03, 04:24
usha_nandini usha_nandini is offline
Registered User
 
Join Date: Sep 2003
Posts: 14
Try strcontractors= "usr_listcontractors ('fl') "
if what has been suggested earlier does not work
Reply With Quote
  #4 (permalink)  
Old 09-23-03, 12:04
fused fused is offline
Registered User
 
Join Date: May 2003
Posts: 23
thanks guys. the issue is solved. the issue lies with the cursortype.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On