Re: VB 6 and MS SQL Server 2000 - (Yudkin)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Since you have multiple SELECT statement, you have multiple result sets.
Since dealing with these is messy, you'd be better ofd reconsidering your
design. The core is the NextRecordSet method of the RecordSet object. You
should work through Books Online to understand what's involved in handling
multiple results sets; it also has sample VB code.

You cannot access the value of a T-SQL variable from your VB code. All you
can do is return it as the value of your SP.

"Vikas" <Vikas@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7C8A547F-D350-462F-B417-B59A9AA64D0D@xxxxxxxxxxxxxxxx
Thanks for your response, Mark.
Perhaps you need a better description of my problem. I'll state my case
more
prcisely :
I have statements like :-

/*
declare @errorcode int
.....
select 'Entering [Proc1] at :' + convert(varchar, getdate(), 109)
exec @errorcode = proc1 param1,param2
if @errorcode = 0
....
.....

begin
select @Var1Name = Name
from table_name1
where age = 50
@Errorcode = @@error
end
.....
If (@errocode = 0)
select '[Proc1] ran successfully'
....
*/

in my stored procedures. Presently I am using SELECT instead of PRINT
command to store concatenated results and other debug statements (as is
seen
above). I want to be able to access these "select statements" and value of
the ErrorCode variable, in Vb6 forms, for display. I was trying to do it
using GetClipString() function which dint work.

If proc1 in turn calls proc2 and proc2 has debug statements, I will need
to
display them as well.
Is it possibe to achieve this without changing SELECT to PRINT ?
If I need to use ADO, what components do I have to include in my project ?

Please suggest a suitable solution.

Thanks in advance

- Vikas


"Mark Yudkin" wrote:

I might be able to, if you were to explain what you want and were to post
your code rather than a very vague and inconsistent sketch.

GetClipString is an RDO API. SQL 2K should be accessed by ADO. Stored
Procedure PRINT statements are returned via the ADO Errors collection,
not
as part of the Recordset. See also KB294178 for a problem and workaround.

SQL SP's have no concept of event flows. Perhaps you're talking about ADO
events? In that case you will need to consider that execution of a SP is
a
single action in ADO terms.

"Vikas" <Vikas@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D710CA61-BA2B-46A0-A883-999D40C8D15B@xxxxxxxxxxxxxxxx


"Vikas" wrote:

I have debug statements in my Stored Procedures, which I want to
display
it
to a "text" control placed on a VB6.0 form as events flow from one SP
to
another.

In short, I want to trace the path ,of the flow of events, at the
server
side. Customized debug statements as well as errors, if any.

I connected the first SP (from wher I want the trace to start) to a
recordet
object. Then tried using GetClipString() function. But it doesnt go
through
the entire flow.

Please help.





.



Relevant Pages

  • Re: VB 6 and MS SQL Server 2000 - (Yudkin)
    ... declare @errorcode int ... If I need to use ADO, what components do I have to include in my project? ... GetClipString is an RDO API. ... SQL SP's have no concept of event flows. ...
    (microsoft.public.vb.general.discussion)
  • Re: commandBuilder Update SQL generation for > 1 table?
    ... > allow updates of ad-hoc queries in a data grid involving multiple ... In old school ado, you'd have a bitch of a time grabbing a ... recordset from SQL Server and having it elegantly created in excel. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: VB 6 and MS SQL Server 2000
    ... SQL 2K should be accessed by ADO. ... as part of the Recordset. ... SQL SP's have no concept of event flows. ... In short, I want to trace the path,of the flow of events, at the server ...
    (microsoft.public.vb.general.discussion)
  • Re: ADO and Multithreading
    ... >I am devloping av program for merging PDF-files at specific times during the ... Multiple merges can occur at the same time and therefore I will use ... >I am also able to get access to the database using ADO and retreive data. ...
    (alt.comp.lang.borland-delphi)
  • Re: Microsoft Access and Multiple result sets
    ... > With ADO v1.1 you can return multiple result sets via a single DataReader. ... the Jet OleDb provider does not support multiple SQL commands. ...
    (microsoft.public.data.ado)