Monday, February 13, 2012

ADO and the RowID

I am trying to update a SQL db record with ADO commands from an asp page thru a stored proc using the RowID and it is not working. RowID is the Identity seed record.

Here is the stored proc:

CREATE PROCEDURE [sp_Update_tblECMTimeTrackingMain]
@.RowID int,
@.StartTime datetime,
@.EndTime datetime,
@.TransxStatus varchar(50)
AS
Begin
UPDATE [tblECMTimeTrackingMain]
SET FStartTime = @.StartTime,
FEndTime = @.EndTime,
TransxStatus = @.TransxStatus
where RowID = @.RowID
End
GO

Here is the asp/ado code:

set cmdINSERT = Server.CreateObject("ADODB.command") cmdINSERT.ActiveConnection = strCONN_DATA cmdINSERT.CommandText = "[sp_Update_tblECMTimeTrackingMain]" cmdINSERT.CommandType = 4

set param = cmdINSERT.CreateParameter("@.RowID",3,1,4) cmdINSERT.Parameters.Append param

set param = cmdINSERT.CreateParameter("@.FStartTime",135,1,8) cmdINSERT.Parameters.Append param

set param = cmdINSERT.CreateParameter("@.FEndTime",135,1,8) cmdINSERT.Parameters.Append param

set param = cmdINSERT.CreateParameter("@.TransxStatus",129,1,50) cmdINSERT.Parameters.Append param

cmdINSERT.Parameters(0) = CInt(mACTREFNUM) ...when I change this to "568" it actually does the update. Yes there is something in mACTREFNUM.

cmdINSERT.Parameters(1) = meStartTime

cmdINSERT.Parameters(2) = meEndTime

cmdINSERT.Parameters(3) = meStatus

cmdINSERT.Execute lngRECS,,128

Any clues?

Is there any indication as to what, if any, error is happening? What value is stored in mACTREFNUM and can you verify that the result of CInt(mACTREFNUM) is, in fact, an integer value?

Thanks,

Jason

No comments:

Post a Comment