voici ma procedure stockée:
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
ALTER PROCEDURE ps_dde
@typedde varchar(100) , @nommat varchar(100),@date datetime ,@desppanne varchar(8000), @code int output AS
-- récupérer le n° dde +1 du dernier enregistrement dans la bdd
declare @id int
set @id = 1
select @id = numdde + 1 from dde_en_attente
/*If @id < @demande
begin
Set @Output = -1
Set @Message = 'Ce n°demande est erronné !'
Goto LBL_ERREUR
end*/
insert into dde_en_attente (numdde,typedde, nommat,datedde,desppanne ) values (@id,@typedde,@nommat,@date, @desppanne)
select @code= @@identity
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
------------------------------------------------------------------------------------------
et voici mon code asp:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
[ Lien ]">
<html>
<head>
<title>Document sans nom</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
'declaration des variables
Dim Cmd_Db, RS
Dim typedde, Pm_typedde
Dim mommat, Pm_nommat
Dim datedde, Pm_datedde
Dim desppanne, Pm_desppanne
'### - Récupération des Informations du Formulaire
typedde = Request.form("typedde")
nommat= Request.form("nommat")
datedde= Request.form("datedde")
desppanne= Request.form("desppanne")
'### - Création de la Commande à Exécuter
set myconn = server.createobject("adodb.connection")
Session("ConnectionString") = "driver={SQL Server};" & "server=dev3;uid=sa;pwd=sa;DATABASE=Amd"
myconn.open Session("connectionString")
Set Cmd_Db = Server.CreateObject("AdoDB.Command")
Cmd_Db.CommandText = "Ps_dde"
'Cmd_Db.CommandType = adCmdStoredProc
'### - Définition des Paramètres de la Procédure Stockée SQL
Set Pm_typedde = Cmd_Db.CreateParameter("@typedde", adVarchar, adParamInput, 100, typedde) : Cmd_Db.Parameters.Append Pm_typedde
Set Pm_nommat = Cmd_Db.CreateParameter("@nommat", adVarchar, adParamInput, 100, nommat) : Cmd_Db.Parameters.Append Pm_nommat
Set Pm_datedde = Cmd_Db.CreateParameter("@date", adDBDate, adParamInput, , datedde) : Cmd_Db.Parameters.Append Pm_datedde
Set Pm_desppanne = Cmd_Db.CreateParameter("@desppanne", adVarchar, adParamInput, 8000, desppanne) : Cmd_Db.Parameters.Append Pm_desppanne
'### - Exécution de la Commande SQL
Set RS = Cmd_Db.Execute
'fermer RS et myconn
RS.close
myconn.close
'liberer les ressources alouées
set myconn = nothing
set RS = nothing%>
</body>
</html>