Re: OLE DB Consumer Templates

Kim Gräsman <[email protected]> Thu, 9 Jan 2003 17:22:58 +0100
Newsgroups gmane.comp.windows.devel.oledb.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.

------_=_NextPart_001_01C2B7FB.5FAF8181
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Erik,
=20
I think you'll have to treat it as a BLOB. We did this once, and got =
results back as BSTRs until the result grew above a certain size, then =
it was automatically coerced into a BLOB field by the provider (or at =
least that's how we interpreted it). Kind of fishy behaviour if you ask =
me.
=20
Anyway, Bob Beauchemin has some good BLOB samples on his site [1], IIRC. =

=20
Hope that helps,
Kim
=20
[1] http://staff.develop.com/bobb/  <http://www.develop.com/bobb>=20

-----Original Message-----
From: Erik Valdes [mailto:[email protected]]
Sent: den 9 januari 2003 17:22
To: [email protected]
Subject: Re: OLE DB Consumer Templates



The reason I can't allocate on the stack is that my variable can be any =
length.  It essentially boils down to the string representation of an =
xml file.  That file can be any size.  When I pass it to my SP, the sp's =
parameter is ntext (to allow for any size).   What do people do when =
they want to pass XML of unknown length to a SQL Server stored =
procedure?

=20

-----Original Message-----
From: Peter Moss [mailto:[email protected]]=20
Sent: Thursday, January 09, 2003 7:58 AM
To: [email protected]
Subject: Re: [OLEDB_DEV] OLE DB Consumer Templates

=20

If I remember right, you can't use the macros for heap-allocated =
variables.  If you dig into the macro definitions, I believe you will =
find that pointers offset from the beginning of 'this' are used.  Thus, =
a heap-allocated variable like m_WorkRequest will not work.

=20

Why can't you just allocate a TCHAR on the stack frame of the object, =
ie,

=20

TCHAR m_WorkRequest[257];     // Or 1 + the size of your SP parameter =
size

=20

Then you can just use COLUMN_ENTRY.

=20

HTH,

Peter

-----Original Message-----
From: OLEDB_DEV [mailto:[email protected]]On Behalf Of Erik =
Valdes
Sent: Wednesday, January 08, 2003 5:22 PM
To: [email protected]
Subject: [OLEDB_DEV] OLE DB Consumer Templates

I'm having trouble implementing an accessor.  I'm trying to use a =
variable (m_WorkRequest) that's dynamically allocated as the variable =
that's bound to a parameter in my accessor (commented line below).   The =
reason I need it to be dynamic is that it is XML and can be any length.  =
The stored proc's parameter is of ntext type to handle the variable =
length.  However, I don't know at compile time how big to make the =
buffer for my parameter in my accessor.  What's the proper way to do =
this?  I've tried COLUMN_ENTRY (access violation), COLUMN_ENTRY_LENGTH =
(different variations produce different errors, but basically I can't =
set the length), COLUMN_ENTRY_TYPE_SIZE (similar problems as the =
previous).  I'm running out of ideas now.  The code below is just one of =
many, many variations I've tried.

=20

=20

class CAddWorkRequest

{

public:

   CAddWorkRequest() STD_INIT

   ~CAddWorkRequest()

   {=20

      if (m_WorkRequest)

         delete [] m_WorkRequest;

   }

   LONG m_RETURNVALUE;

   LPTSTR m_WorkRequest;

   LONG m_lLength;

=20

   void SetStringParam(LPCTSTR szString,int cBytes)

   {

      m_WorkRequest =3D (LPTSTR) new TCHAR[cBytes];

      _tcsncpy(m_WorkRequest,szString,cBytes);

      m_lLength =3D _tcslen(m_WorkRequest);

   })

=20

BEGIN_PARAM_MAP(CAddWorkRequest)

   SET_PARAM_TYPE(DBPARAMIO_OUTPUT)

   COLUMN_ENTRY(1, m_RETURNVALUE)

   SET_PARAM_TYPE(DBPARAMIO_INPUT)

//   COLUMN_ENTRY_TYPE_SIZE(2,DBTYPE_STR,_tcslen(m_WorkRequest), =
m_WorkRequest)

=20

=20

END_PARAM_MAP()

=20

DEFINE_COMMAND(CAddWorkRequest, _T("{ ? =3D CALL dbo.AddWorkRequest;1 =
(?) }"))

=20

};

=20

class CAddWorkRequestCommand : public CBsDbCommand<CAddWorkRequest>

{

};

=20

foo (LPTSTR szWor)

{

            CAddWorkRequestCommand cmd;

            cmd.SetStringParam(szWor,_tcslen(szWor)+1);

cmd.Open();

}

=20

You can read messages from the OLEDB_DEV archive, unsubscribe from =
OLEDB_DEV, or subscribe to other DevelopMentor lists at =
http://discuss.develop.com.=20

You can read messages from the OLEDB_DEV archive, unsubscribe from =
OLEDB_DEV, You can read messages from the OLEDB_DEV archive, unsubscribe =
from OLEDB_DEV, or subscribe to other DevelopMentor lists at =
http://discuss.develop.com. or subscribe to other DevelopMentor lists at =
http://discuss.develop.com.


You can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.

------_=_NextPart_001_01C2B7FB.5FAF8181
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">


<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE>@font-face {
        font-family: Tahoma;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.emailstyle17 {
        COLOR: windowtext; FONT-FAMILY: Arial
}
SPAN.EmailStyle18 {
        COLOR: navy; FONT-FAMILY: Arial
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=3DEN-US vLink=3Dpurple link=3Dblue>
<DIV><SPAN class=3D458302016-09012003><FONT face=3D"Courier New" =
color=3D#000080=20
size=3D2>Erik,</FONT></SPAN></DIV>
<DIV><SPAN class=3D458302016-09012003><FONT face=3D"Courier New" =
color=3D#000080=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D458302016-09012003><FONT face=3D"Courier New" =
color=3D#000080=20
size=3D2>I think you'll have to treat it as a BLOB. We did this once, =
and got=20
results back as BSTRs until the result grew above a certain size, then =
it was=20
automatically coerced into a BLOB field by the provider (or at least =
that's how=20
we interpreted it). </FONT></SPAN><SPAN class=3D458302016-09012003><FONT =

face=3D"Courier New" color=3D#000080 size=3D2>Kind of fishy behaviour if =
you ask=20
me.</FONT></SPAN></DIV>
<DIV><SPAN class=3D458302016-09012003><FONT face=3D"Courier New" =
color=3D#000080=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D458302016-09012003><FONT face=3D"Courier New" =
color=3D#000080=20
size=3D2>Anyway, Bob Beauchemin has some good BLOB samples on his site =
[1], IIRC.=20
</FONT></SPAN></DIV>
<DIV><SPAN class=3D458302016-09012003><FONT face=3D"Courier New" =
color=3D#000080=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D458302016-09012003><FONT face=3D"Courier New" =
color=3D#000080=20
size=3D2>Hope that helps,</FONT></SPAN></DIV>
<DIV><SPAN class=3D458302016-09012003><FONT face=3D"Courier New" =
color=3D#000080=20
size=3D2>Kim</FONT></SPAN></DIV>
<DIV><SPAN class=3D458302016-09012003><FONT face=3D"Courier New" =
color=3D#000080=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D458302016-09012003><FONT face=3D"Courier New" =
color=3D#000080=20
size=3D2>[1] <A=20
href=3D"http://staff.develop.com/bobb/">http://staff.develop.com/bobb/</A=
><A=20
href=3D"http://www.develop.com/bobb"></A> </FONT></SPAN></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000080 2px =
solid">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B> Erik Valdes=20
  [mailto:[email protected]]<BR><B>Sent:</B> den 9 januari =
2003=20
  17:22<BR><B>To:</B> [email protected]<BR><B>Subject:</B> =
Re: OLE=20
  DB Consumer Templates<BR><BR></FONT></DIV>
  <DIV class=3DSection1>
  <P class=3DMsoNormal><FONT face=3DArial color=3Dnavy size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">The reason =
I can't=20
  allocate on the stack is that my variable can be any length.&nbsp; It=20
  essentially boils down to the string representation of an xml file. =
&nbsp;That=20
  file can be any size.&nbsp; When I pass it to my SP, the sp's =
parameter is=20
  ntext (to allow for any size).&nbsp;&nbsp; What do people do when they =
want to=20
  pass XML of unknown length to a SQL Server stored =
procedure?</SPAN></FONT></P>
  <P class=3DMsoNormal><FONT face=3DArial color=3Dnavy size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: =
Arial"></SPAN></FONT>&nbsp;</P>
  <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DTahoma =
size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original=20
  Message-----<BR><B><SPAN style=3D"FONT-WEIGHT: bold">From:</SPAN></B> =
Peter Moss=20
  [mailto:[email protected]] <BR><B><SPAN=20
  style=3D"FONT-WEIGHT: bold">Sent:</SPAN></B> Thursday, January 09, =
2003 7:58=20
  AM<BR><B><SPAN style=3D"FONT-WEIGHT: bold">To:</SPAN></B>=20
  [email protected]<BR><B><SPAN=20
  style=3D"FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [OLEDB_DEV] OLE DB =
Consumer=20
  Templates</SPAN></FONT></P>
  <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3D"Times =
New Roman"=20
  size=3D3><SPAN style=3D"FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
  <DIV>
  <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
color=3Dblue=20
  size=3D2><SPAN style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: =
Arial">If I=20
  remember right, you can't use the macros for heap-allocated =
variables.&nbsp;=20
  If you dig into the macro definitions, I believe you will find that =
pointers=20
  offset from the beginning of 'this' are used.&nbsp; Thus, a =
heap-allocated=20
  variable like m_WorkRequest will not work.</SPAN></FONT></P></DIV>
  <DIV>
  <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3D"Times =
New Roman"=20
  size=3D3><SPAN style=3D"FONT-SIZE: =
12pt"></SPAN></FONT>&nbsp;</P></DIV>
  <DIV>
  <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
color=3Dblue=20
  size=3D2><SPAN style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: =
Arial">Why=20
  can't you just allocate a TCHAR on the stack frame of the object,=20
  ie,</SPAN></FONT></P></DIV>
  <DIV>
  <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3D"Times =
New Roman"=20
  size=3D3><SPAN style=3D"FONT-SIZE: =
12pt"></SPAN></FONT>&nbsp;</P></DIV>
  <DIV>
  <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
color=3Dblue=20
  size=3D2><SPAN style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: =
Arial">TCHAR=20
  m_WorkRequest[257];&nbsp;&nbsp;&nbsp;&nbsp; // Or 1 + the size of your =
SP=20
  parameter size</SPAN></FONT></P></DIV>
  <DIV>
  <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3D"Times =
New Roman"=20
  size=3D3><SPAN style=3D"FONT-SIZE: =
12pt"></SPAN></FONT>&nbsp;</P></DIV>
  <DIV>
  <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
color=3Dblue=20
  size=3D2><SPAN style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: =
Arial">Then you=20
  can just use COLUMN_ENTRY.</SPAN></FONT></P></DIV>
  <DIV>
  <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3D"Times =
New Roman"=20
  size=3D3><SPAN style=3D"FONT-SIZE: =
12pt"></SPAN></FONT>&nbsp;</P></DIV>
  <DIV>
  <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
color=3Dblue=20
  size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: =
Arial">HTH,</SPAN></FONT></P></DIV>
  <DIV>
  <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
color=3Dblue=20
  size=3D2><SPAN=20
  style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: =
Arial">Peter</SPAN></FONT></P></DIV>
  <BLOCKQUOTE style=3D"MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt">
    <P class=3DMsoNormal=20
    style=3D"MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 0.5in; MARGIN-RIGHT: =
0in"><FONT=20
    face=3DTahoma size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original=20
    Message-----<BR><B><SPAN style=3D"FONT-WEIGHT: =
bold">From:</SPAN></B>=20
    OLEDB_DEV [mailto:[email protected]]<B><SPAN=20
    style=3D"FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Erik =
Valdes<BR><B><SPAN=20
    style=3D"FONT-WEIGHT: bold">Sent:</SPAN></B> Wednesday, January 08, =
2003 5:22=20
    PM<BR><B><SPAN style=3D"FONT-WEIGHT: bold">To:</SPAN></B>=20
    [email protected]<BR><B><SPAN=20
    style=3D"FONT-WEIGHT: bold">Subject:</SPAN></B> [OLEDB_DEV] OLE DB =
Consumer=20
    Templates</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I'm having trouble =
implementing=20
    an accessor. &nbsp;I'm trying to use a variable (m_WorkRequest) =
that's=20
    dynamically allocated as the variable that's bound to a parameter in =
my=20
    accessor (commented line below).&nbsp; &nbsp;The reason I need it to =
be=20
    dynamic is that it is XML and can be any length.&nbsp; The stored =
proc's=20
    parameter is of ntext type to handle the variable length.&nbsp; =
However, I=20
    don't know at compile time how big to make the buffer for my =
parameter in my=20
    accessor.&nbsp; What's the proper way to do this?&nbsp; I've tried=20
    COLUMN_ENTRY (access violation), COLUMN_ENTRY_LENGTH (different =
variations=20
    produce different errors, but basically I can't set the length),=20
    COLUMN_ENTRY_TYPE_SIZE (similar problems as the previous).&nbsp; I'm =
running=20
    out of ideas now.&nbsp; The code below is just one of many, many =
variations=20
    I've tried.</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">class=20
    CAddWorkRequest</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">{</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">public:</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp; =
CAddWorkRequest()=20
    STD_INIT</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;=20
    ~CAddWorkRequest()</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp; {=20
</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
    if (m_WorkRequest)</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
    delete [] m_WorkRequest;</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp; =
}</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp; LONG=20
    m_RETURNVALUE;</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp; LPTSTR=20
    m_WorkRequest;</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp; LONG=20
    m_lLength;</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp; void=20
    SetStringParam(LPCTSTR szString,int cBytes)</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp; =
{</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
    m_WorkRequest =3D (LPTSTR) new TCHAR[cBytes];</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
    _tcsncpy(m_WorkRequest,szString,cBytes);</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
    m_lLength =3D _tcslen(m_WorkRequest);</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;=20
})</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">BEGIN_PARAM_MAP(CAddWorkRequest)</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;=20
    SET_PARAM_TYPE(DBPARAMIO_OUTPUT)</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp; =
COLUMN_ENTRY(1,=20
    m_RETURNVALUE)</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;=20
    SET_PARAM_TYPE(DBPARAMIO_INPUT)</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">//&nbsp;&nbsp;=20
    COLUMN_ENTRY_TYPE_SIZE(2,DBTYPE_STR,_tcslen(m_WorkRequest),=20
    m_WorkRequest)</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">END_PARAM_MAP()</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">DEFINE_COMMAND(CAddWorkRequest,=20
    _T("{ ? =3D CALL dbo.AddWorkRequest;1 (?) }"))</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
size=3D2><SPAN=20
    style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">};</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt">class =
CAddWorkRequestCommand : public=20
    CBsDbCommand&lt;CAddWorkRequest&gt;</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt">{</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt">};</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt">foo (LPTSTR =
szWor)</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt">{</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN=20
    style=3D"FONT-SIZE: =
12pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =

    CAddWorkRequestCommand cmd;</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN=20
    style=3D"FONT-SIZE: =
12pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =

    cmd.SetStringParam(szWor,_tcslen(szWor)+1);</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in; TEXT-INDENT: =
0.5in"><FONT=20
    face=3D"Times New Roman" size=3D3><SPAN=20
    style=3D"FONT-SIZE: 12pt">cmd.Open();</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt">}</SPAN></FONT></P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Times New Roman"=20
    size=3D3><SPAN style=3D"FONT-SIZE: 12pt">You can read messages from =
the=20
    OLEDB_DEV archive, unsubscribe from OLEDB_DEV, or subscribe to other =

    DevelopMentor lists at http://discuss.develop.com.=20
  </SPAN></FONT></P></BLOCKQUOTE></DIV>You can read messages from the =
OLEDB_DEV=20
  archive, unsubscribe from OLEDB_DEV, You can read messages from the =
OLEDB_DEV=20
  archive, unsubscribe from OLEDB_DEV, or subscribe to other =
DevelopMentor lists=20
  at http://discuss.develop.com. or subscribe to other DevelopMentor =
lists at=20
  http://discuss.develop.com.</BLOCKQUOTE></BODY></HTML>
You can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.

------_=_NextPart_001_01C2B7FB.5FAF8181--