selectphp
================= Stored Procedure =======================
ALTER PROCEDURE [dbo]. [Creatuser]
--Add The parameters for the stored procedure here
@Username varchar (50),
@userPassword varchar (50),
@QQID varchar (11),
@nResult int Output
As
BEGIN
DECLARE @Qid int
Set @Qid =null
Select @Qid =id from [user] where qusername= @Username
If @Qid is not null
Begin
Set @nResult =-1
Goto theend
End
INSERT into [qqmsg]. [Dbo].user
Select @QQID, @Username, @userPassword
Set @nResult =0
TheEND:
SET NOCOUNT on;
END
--=============================================
--author:liushuming
--Create date:today
-- Description:for some usage
--=============================================
ALTER PROCEDURE [dbo].[ Insertfriendgroup]
--ADD The parameters for the stored procedure here
@GroupName varchar,
@Ownerqid Varc Har (one),
@Groupid int output
as
BEGIN
declare @Qid int
Set @Qid =null
Select @Qid =id from [user] whe Re qid= @Ownerqid
If @Qid is null
set @Groupid =-1
Else
begin
Set @Qid =null
Select @Qid =id from [QQ MSG]. [dbo]. [Friendqidfolder] WHERE [ownerqid]= @Ownerqid and [foldername]= @GroupName
If @Qid is null
begin
INSERT into [QQ MSG]. [dbo]. Friendqidfolder
Select @Ownerqid, @GroupName
Select top 1 @Groupid =id from [Friendqidfolder] where
[ownerqid] = @Ownerqid and [foldername]= @GroupName
End
Else
Set @Groupid =-2
endSET NOCOUNT ON;
END
====================asp file ==================
Dim username,userpassword,qqid
Username=request ("Username"): Username=checkstr (Username)
Userpassword=request ("UserPassword"): Userpassword=checkstr (UserPassword)
Qqid=request ("Qqid"): Qqid=checkstr (qqid)
Username=trim (Username): Userpassword=trim (UserPassword): Qqid=trim (qqid)
If Username= "" or userpassword= "" or qqid= "" Then
Response.Write "Err"
Else
Call StoreData ()
End If
Call Closeconn ()
Sub StoreData ()
On Error Resume Next
Dim CMD
Set cmd = Server.CreateObject ("Adodb.command")
Set cmd. Activeconnection=conn
Cmd.commandtext= "[Creatuser]"
Cmd.commandtype=4
cmd.Parameters.Append cmd.CreateParameter("@Username",201,1,50) cmd.Parameters.Append cmd.CreateParameter("@userPassword",201,1,50) cmd.Parameters.Append cmd.CreateParameter("@QQID",201,1,11) cmd.Parameters.Append cmd.CreateParameter("@nResult",3,2,4) cmd("@Username")=Username cmd("@userPassword")=userPassword cmd("@QQID")=QQID Cmd.Execute
If Err Then
Response.Write "Err" &err.description
Else
Response.Write Cmd ("@nResult")
End If
End Sub