PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.server > Could not find prepared statement
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Could not find prepared statement

Réponse
 
LinkBack Outils de la discussion
Vieux 13/06/2008, 01h41   #1
Mark
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Could not find prepared statement

First of all, my apologies for doing a re-post, but I didn't get a response
from the ODBC section.... So here it is again.....

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



  Réponse avec citation
Vieux 13/06/2008, 04h10   #2
Eric Isaacs
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Could not find prepared statement

> declare @p1 int
> set @p1=1
> exec sp_prepexec @p1 output,N'@P1 nvarchar(5)',N'SELECT userid


It looks like it's passing @p1 as an OUTPUT parameter. If it has a
value, it might need to be an INOUT parameter instead of an OUTPUT
parameter.
  Réponse avec citation
Vieux 13/06/2008, 14h42   #3
Dan Guzman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Could not find prepared statement

> 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).


sp_prepexec is an undocumented proc that is part of the client API. This
error could be a result of an application error (i.e. calling API methods in
the wrong sequence) or an API bug. I don't know anything about CGI but you
might try posting the relevant code snippet in case someone can spot
something.

--
Hope this s.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/

"Mark" <Mark@discussions.microsoft.com> wrote in message
news:1E67FC65-E5E1-42AB-BB10-B0CCB5479CD3@microsoft.com...
> First of all, my apologies for doing a re-post, but I didn't get a
> response
> from the ODBC section.... So here it is again.....
>
> 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
>
>
>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h06.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12207 seconds with 11 queries