Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
SQL
ce
clients
clustering
connect
datamining
datawarehouse
dts
fulltext
jdbcdriver
msde
mseq
newusers
notificationsvcs
odbc
olap
programming
replication
reportingsvcs
security
securitytools
server
setup
sqlxml.viewmapper
tools
xml
  
 
date: Wed, 11 Jun 2008 17:34:00 -0700,    group: microsoft.public.sqlserver.odbc        back       


sp_preprexec error   
Hello,

I am receiving the following error when sending a paramaterized statement 
from a web page to SQL Server via ODBC connection

Msg 8179, Level 16, State 2, Procedure sp_prepexec, Line 1
Could not find prepared statement with handle 1.


Here is the captured statements received by SQL server (captured by Profiler):

declare @p1 int
set @p1=1
exec sp_prepexec @p1 output,N'@P1 nvarchar(5)',N'SELECT userid
FROM   usertable
WHERE  username = @P1
',N'admin'
select @p1

The odd thing is, if I copy and paste into Query Anylzer,  and comment out 
line 2 (set @p1=1), it works fine.....uncomment line 2 and I get the same 
error.

Can anyone tell me the cause of this and a possible work around?  I don't 
know how to tell the CGI script on the web page not set a value of @p1 (not 
sure it is even responsible for doing it).

Thanks,
Mark
date: Wed, 11 Jun 2008 17:34:00 -0700   author:   Mark

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us