February 20, 2005 at 11:05 am
hi,
i want to send a variable to sp from vb6.
CREATE PROCEDURE dbo.AddNewRec
(
@T_CID int,
@T_DeadLine int
)
AS
INSERT INTO tblRequest
(
T_CID,
T_Date,
T_DeadLine
)
VALUES
(
@T_CID,
GETDATE(),
GETDATE() + 30 minutes ???????????
)
GO
iwant to fill T_DeadLine field with the value of GETDATE() + anyMin ( ill send this anyMin from my vb app)
how can i send minute to sp?
thanx all.
February 20, 2005 at 11:54 am
You can do a different approach to this
Pass the minutes in a parameter. with the use of DateADD function u can insert the nesseray time into the table
My Blog:
February 21, 2005 at 2:02 am
February 21, 2005 at 7:36 am
Do a SP in SQL 2000 and from VB use ADODB.CONNECTION and ADODB.COMMAND objects.
Vasc
February 21, 2005 at 10:09 pm
change your sp Like this..
CREATE PROCEDURE dbo.AddNewRec
(
@T_CID int,
@T_DeadLine int
)
AS
INSERT INTO tblRequest
(
T_CID,
T_Date,
T_DeadLine
)
VALUES
(
@T_CID,
GETDATE(),
DateAdd(n,30,GETDATE() )
)
GO
IN VB do the Following Steps
1) Create a Connection Object and Set the Connection string And Open the connection
2) Create a command Object, Set the Connection property and CommandText Property.
3) Create 2 parameter object for SP Parameters,
4) Add the paremeters to the Paramaters Collection property of the command object.
5) Execute the Command.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply