Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #5490

Re: Debug options Vo2Ado when using SQL Express?

From "Er!k \\/!$$Er" <nospam@nospam.url>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Debug options Vo2Ado when using SQL Express?
Date 2013-07-11 14:04 +0200
Organization Netfront http://www.netfront.net/
Message-ID <krm70m$1247$1@adenine.netfront.net> (permalink)
References <5c53e6e7-c12c-4ac7-a8d9-4696c30a06a9@googlegroups.com>

Show all headers | View raw


Rob,

Google for TSQL DEBUG STORED PROCEDURE
This is not a (VO2)ADO problem.
In fact, under what circumstances do you expect count(..) to return a null 
value?

If you execute this :  SELECT count(0) WHERE  0=1 you get 0 and not null

hth

Erik


"Rob van Erk"  schreef in bericht 
news:5c53e6e7-c12c-4ac7-a8d9-4696c30a06a9@googlegroups.com...

I am struggling to find the root cause of my Vo2Ado code not doing what I 
expect it should do using a SQL Express DB. My main question is : what are 
the debug options I have in SQL Express (like the debug options VO is 
offering in VO2.8) to find the root cause of my issue? For example, the 
below is just executed but dos not seem to work at all.

oCmd := AdoCommand{}
oCmd:ActiveConnection := oConn
oCmd:CommandText := "SP_InsertRec"
oCmd:CommandType := AdCmdStoredProc

oPars := oCmd:PARAMETERS_
oPar  := oCmd:CreateParameter("sDevice", adChar,adParamInput,nil,sDevice)
oPars:Append(oPar)
oPar  := oCmd:CreateParameter("sPCName", adChar,adParamInput,nil,sPCname)
oPars:Append(oPar)

oRecordset := oCmd:Execute(nil,nil,nil)

***************************************
*** Stored procedure in SQL Express ***
***************************************
PROCEDURE [dbo].[SP_InsertRec]
@sDevice CHAR(30),
@sPCName CHAR(30)

AS
BEGIN
DECLARE @sKey    CHAR(40)
DECLARE @sUser   CHAR(40)
DECLARE @sDate   CHAR(40)
DECLARE @nROWS   INT

SET @skey  = CURRENT_USER + GETDATE()
SET @sUser = CURRENT_USER
SET @sDate = GETDATE()
SET @nROWS = 0

BEGIN TRANSACTION
    SELECT @nROWS = count(username) FROM DBTIMEREG WHERE UNIQUEKEY = @sKEY
--    IF @nROWS is null
//    Apparently the above statement is not allowed in MS Stored Procedure
       BEGIN
          INSERT INTO [DBTIMEREG] 
(username,logindate,device,pcname,uniquekey)
          VALUES(@sUser,@sDate,@sDevice,@sPcname,@sKey)
       END
--    END
COMMIT TRANSACTION
RETURN;
END 


--- news://freenews.netfront.net/ - complaints: news@netfront.net ---

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Debug options Vo2Ado when using SQL Express? Rob van Erk <erk.v@hotmail.com> - 2013-07-10 13:16 -0700
  Re: Debug options Vo2Ado when using SQL Express? Willie Moore <williem@wmconsulting.com> - 2013-07-11 11:30 +0000
  Re: Debug options Vo2Ado when using SQL Express? Johan Nel <johan.nel@xsinet.co.za> - 2013-07-11 05:01 -0700
  Re: Debug options Vo2Ado when using SQL Express? "Er!k \\/!$$Er" <nospam@nospam.url> - 2013-07-11 14:04 +0200
  Re: Debug options Vo2Ado when using SQL Express? Johan Nel <johan.nel@xsinet.co.za> - 2013-07-11 05:20 -0700
  Re: Debug options Vo2Ado when using SQL Express? Rob van Erk <erk.v@hotmail.com> - 2013-07-11 09:58 -0700
    Re: Debug options Vo2Ado when using SQL Express? "Er!k \\/!$$Er" <nospam@nospam.url> - 2013-07-11 20:09 +0200
  Re: Debug options Vo2Ado when using SQL Express? Rob van Erk <erk.v@hotmail.com> - 2013-07-11 12:25 -0700

csiph-web