Showing posts with label commands. Show all posts
Showing posts with label commands. Show all posts

Monday, February 13, 2012

ADO connection options

I noticed when connecting to SQL Server using the SQL OLEDB provider that a
number of SET commands are issued. In particular
SET CONCAT_NULL_YIELDS_NULL ON
is issued, and I'd like to change that to OFF. I've set the database option
to turn this off by default, but all of the client connections still issue
the command. Is there a way in the connect string to specify SET options?
Thanks,
TomI don=B4t know of any settings to manipulate this. You only chance for
this is to put the command in your batch fired against the SQL Server.
HTH, jens Suessmeyer.|||Change you query to ISNULL(column,'')
Tom wrote:
> I noticed when connecting to SQL Server using the SQL OLEDB provider that
a
> number of SET commands are issued. In particular
> SET CONCAT_NULL_YIELDS_NULL ON
> is issued, and I'd like to change that to OFF. I've set the database opti
on
> to turn this off by default, but all of the client connections still issue
> the command. Is there a way in the connect string to specify SET options?
> Thanks,
> Tom

ADO connection options

I noticed when connecting to SQL Server using the SQL OLEDB provider that a
number of SET commands are issued. In particular
SET CONCAT_NULL_YIELDS_NULL ON
is issued, and I'd like to change that to OFF. I've set the database option
to turn this off by default, but all of the client connections still issue
the command. Is there a way in the connect string to specify SET options?
Thanks,
Tom
I don=B4t know of any settings to manipulate this. You only chance for
this is to put the command in your batch fired against the SQL Server.
HTH, jens Suessmeyer.
|||Change you query to ISNULL(column,'')
Tom wrote:
> I noticed when connecting to SQL Server using the SQL OLEDB provider that a
> number of SET commands are issued. In particular
> SET CONCAT_NULL_YIELDS_NULL ON
> is issued, and I'd like to change that to OFF. I've set the database option
> to turn this off by default, but all of the client connections still issue
> the command. Is there a way in the connect string to specify SET options?
> Thanks,
> Tom

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

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