Re: AW: [OLEDB_DEV] OLE DB Consumer Templates
Peter Moss <[email protected]> Thu, 9 Jan 2003 16:14:22 -0500
| Newsgroups | gmane.comp.windows.devel.oledb.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
------=_NextPart_000_0057_01C2B7FA.2C08DAC0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
RE: [OLEDB_DEV] AW: [OLEDB_DEV] OLE DB Consumer TemplatesSince we're talking
about memory usage, can we back up 1 minute and ask Erik what is the source
of the XML data? Is it from a DOM, say implemented using MSXML (or for that
matter any object that exposes IStream for serialization)? If so, you might
also look into the fact that the DOM exposes IStream* so you could serialize
the DOM directly into the DB using OLE DB.
If this is the case, I am sure that I and others have done this in the past
and could supply examples. If your XML source is just in a string somewhere,
then proceed along the lines you are proceeding now.
Peter
-----Original Message-----
From: OLEDB_DEV [mailto:[email protected]]On Behalf Of Erik
Valdes
Sent: Thursday, January 09, 2003 4:05 PM
To: [email protected]
Subject: Re: [OLEDB_DEV] AW: [OLEDB_DEV] OLE DB Consumer Templates
Hi Duncan,
You've gone one step further than I expected. I'm not sure I understand
the relevance of who owns the memory. However, I had not tried using
DBTYPE_BYREF at all so that is something I need to try. Why is the memory
owner important for this issue?
Thanks,
Erik
-----Original Message-----
From: Duncan Smith [mailto:[email protected]]
Sent: Thursday, January 09, 2003 1:21 PM
To: [email protected]
Subject: Re: [OLEDB_DEV] AW: [OLEDB_DEV] OLE DB Consumer Templates
I encountered this exact issue. I wanted to pass a string buffer
containing XML data to the provider using client-owned memory. The OLE DB
data type I use is DBTYPE_STR | DBTYPE_BYREF. Using the standard OLE DB
consumer template macros will result in this being provider-owned memory
(see CAccessorBase::Bind in atldbcli.h). So I created my own CAccessorBase
type class (called CAccessorBaseEx below) with 2 static methods and created
my own bind macro as follows:
// This macro is to be used in place of _COLUMN_ENTRY_CODE (in atldbcli.h)
for a parameter or
// column whose type has the DBTYPE_BYREF bit set. CAccessorBase::Bind
always sets dwMemOwner
// to DBMEMOWNER_PROVIDEROWNED if the DBTYPE_BYREF bit set. This macro
changes that behavior by
// setting dwMemOwner to the value passed as the last macro parameter.
// Use COLUMN_ENTRY_EX_BYREF instead of COLUMN_ENTRY_EX (in atldbcli.h)
for DBTYPE_BYREF entries.
#define _COLUMN_ENTRY_CODE_BYREF(nOrdinal, wType, nLength, nPrecision,
nScale, dataOffset, lengthOffset, statusOffset, dwMemOwner) \
if (pBuffer != NULL) \
{ \
if (!bClearOnly) \
CAccessorBaseEx::FreeType(wType, pBuffer + dataOffset,
dwMemOwner); \
memset(pBuffer + dataOffset, 0, nLength); \
} \
else if (pBinding != NULL) \
{ \
ATLASSERT( pColumnNames != NULL ); \
*pColumnNames = NULL; \
CAccessorBaseEx::Bind(pBinding, nOrdinal, wType, nLength,
nPrecision, nScale, eParamIO, \
dataOffset, lengthOffset, statusOffset, NULL,
dwMemOwner); \
pColumnNames++; \
pBinding++; \
} \
nColumns++;
#define COLUMN_ENTRY_EX_BYREF(nOrdinal, wType, nLength, nPrecision,
nScale, data, length, status, dwMemOwner) \
_COLUMN_ENTRY_CODE_BYREF(nOrdinal, wType, nLength, nPrecision,
nScale, offsetbuf(data), offsetbuf(length), offsetbuf(status), dwMemOwner)
class CAccessorBaseEx
{
public:
static void Bind(DBBINDING* pBinding, ULONG nOrdinal, DBTYPE wType,
ULONG nLength, BYTE nPrecision, BYTE nScale, DBPARAMIO
eParamIO,
ULONG nDataOffset, ULONG nLengthOffset = NULL, ULONG
nStatusOffset = NULL,
DBOBJECT* pdbobject = NULL, DBMEMOWNER dwMemOwner =
DBMEMOWNER_CLIENTOWNED) throw()
{
ATL::CAccessorBase::Bind(
pBinding,
nOrdinal,
wType,
nLength,
nPrecision,
nScale,
eParamIO,
nDataOffset,
nLengthOffset,
nStatusOffset,
pdbobject);
pBinding->dwMemOwner = dwMemOwner;
}
static inline void FreeType(DBTYPE wType, BYTE* pValue, DBMEMOWNER
dwMemOwner) throw()
{
if ((wType & DBTYPE_BYREF) && (dwMemOwner ==
DBMEMOWNER_CLIENTOWNED))
{
void * pData = *(void **)pValue;
if (pData != NULL)
CoTaskMemFree(pData);
}
else
ATL::CAccessorBase::FreeType(wType, pValue);
}
};
Then the accessor I used has the following (the SQL Server data type I am
using is text):
char * m_pszData;
DBLENGTH m_DataLength;
DBSTATUS m_DataStatus;
...
COLUMN_ENTRY_EX_BYREF(5, DBTYPE_STR | DBTYPE_BYREF, sizeof(char *), 0, 0,
m_pszData, m_DataLength, m_DataStatus, DBMEMOWNER_CLIENTOWNED)
Hope this helps.
Duncan Smith
-----Original Message-----
From: Erik Valdes [mailto:[email protected]]
Sent: Thursday, January 09, 2003 1:17 PM
To: [email protected]
Subject: Re: [OLEDB_DEV] AW: [OLEDB_DEV] OLE DB Consumer Templates
Hi,
I see what you mean about MS recommending the storage object way. I've
found a lot of articles describing that. However, I'm having trouble
finding anything that gives an example of how to do the in-memory way.
Perhaps someone could point me to an example or a how-to document? I'd
really appreciate it.
Thanks,
Erik
-----Original Message-----
From: Yuancai Ye [mailto:[email protected]]
Sent: Thursday, January 09, 2003 9:57 AM
To: [email protected]
Subject: Re: [OLEDB_DEV] AW: [OLEDB_DEV] OLE DB Consumer Templates
Hi,
MS recommends us to use storage object for sending
a BLOB into a data source. However, as I tested, this
way is bad in many cases since your code needs to
create a store object and database needs to recover
binnary data from the store object. You'd better use
in-memory way to send BLOB for faster speed. With use
of in-memory way, the previous two extra steps are
avoided. Therefore, in-memory way is faster. That is
my guess. Test it yourself.
Regards,
Yuancai (Charlie) Ye
--- Rudolf Wiener <[email protected]> wrote:
> Erik,
>
> For reading and writing blobs, which is what you're
> in fact using, I use the
> technologies recommended and stream the data with a
> storage object. The
> macro I use in the accessor is
> BLOB_ENTRY_LENGTH_STATUS. I'm not sure if
> this is the best way to do it because I have the
> impression it slows things
> down a bit. But I haven't had the time yet to look
> into faster alternatives.
>
> If you like I can send you excerpts from my app's
> code.
>
> Regards
> Rudi
>
> -----Urspr黱gliche Nachricht-----
> Von: OLEDB_DEV
> [mailto:[email protected]]Im Auftrag von
> Erik
> Valdes
> Gesendet: Donnerstag, 09. J鋘ner 2003 17:22
> An: [email protected]
> Betreff: Re: [OLEDB_DEV] 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?
>
>
>
> -----Original Message-----
> From: Peter Moss [mailto:[email protected]]
> Sent: Thursday, January 09, 2003 7:58 AM
> To: [email protected]
> Subject: Re: [OLEDB_DEV] OLE DB Consumer Templates
>
>
>
> 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.
>
>
>
> Why can't you just allocate a TCHAR on the stack
> frame of the object, ie,
>
>
>
> TCHAR m_WorkRequest[257]; // Or 1 + the size
> of your SP parameter size
>
>
>
> Then you can just use COLUMN_ENTRY.
>
>
>
> 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.
>
>
>
>
>
> class CAddWorkRequest
>
> {
>
> public:
>
> CAddWorkRequest() STD_INIT
>
> ~CAddWorkRequest()
>
> {
>
> if (m_WorkRequest)
>
> delete [] m_WorkRequest;
>
> }
>
> LONG m_RETURNVALUE;
>
> LPTSTR m_WorkRequest;
>
> LONG m_lLength;
>
>
>
> void SetStringParam(LPCTSTR szString,int
> cBytes)
>
> {
>
> m_WorkRequest = (LPTSTR) new
> TCHAR[cBytes];
>
> _tcsncpy(m_WorkRequest,szString,cBytes);
>
> m_lLength = _tcslen(m_WorkRequest);
>
> })
>
>
>
> 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)
>
>
>
>
>
> END_PARAM_MAP()
>
>
>
> DEFINE_COMMAND(CAddWorkRequest, _T("{ ? = CALL
> dbo.AddWorkRequest;1
> (?) }"))
>
>
>
> };
>
>
>
> class CAddWorkRequestCommand : public
> CBsDbCommand<CAddWorkRequest>
>
> {
>
> };
>
>
>
> foo (LPTSTR szWor)
>
> {
>
>
=== message truncated ===
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.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.
You can read messages from the OLEDB_DEV archive, unsubscribe from
OLEDB_DEV, 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 You can read messages from the OLEDB_DEV archive, unsubscribe from
OLEDB_DEV, or subscribe to other DevelopMentor lists at
http://discuss.develop.com. 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_000_0057_01C2B7FA.2C08DAC0
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><TITLE>RE: [OLEDB_DEV] AW: [OLEDB_DEV] OLE DB Consumer =
Templates</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2722.900" 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: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
COLOR: blue; TEXT-DECORATION: underline
}
P {
FONT-SIZE: 12pt; MARGIN-LEFT: 0in; MARGIN-RIGHT: 0in; FONT-FAMILY: =
"Times New Roman"
}
SPAN.EmailStyle18 {
COLOR: navy; FONT-FAMILY: Arial
}
SPAN.EmailStyle19 {
COLOR: navy; FONT-FAMILY: Arial
}
DIV.Section1 {
page: Section1
}
</STYLE>
</HEAD>
<BODY lang=3DEN-US vLink=3Dblue link=3Dblue>
<DIV><SPAN class=3D343331021-09012003><FONT face=3DArial color=3D#0000ff =
size=3D2>Since=20
we're talking about memory usage, can we back up 1 minute and ask Erik =
what is=20
the source of the XML data? Is it from a DOM, say implemented =
using MSXML=20
(or for that matter any object that exposes IStream for serialization)? =
If=20
so, you might also look into the fact that the DOM exposes IStream* so =
you could=20
serialize the DOM directly into the DB using OLE DB.</FONT></SPAN></DIV>
<DIV><SPAN class=3D343331021-09012003><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D343331021-09012003><FONT face=3DArial color=3D#0000ff =
size=3D2>If=20
this is the case, I am sure that I and others have done this in the past =
and=20
could supply examples. If your XML source is just in a string somewhere, =
then=20
proceed along the lines you are proceeding now.</FONT></SPAN></DIV>
<DIV><SPAN class=3D343331021-09012003><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D343331021-09012003><FONT face=3DArial color=3D#0000ff =
size=3D2>Peter</FONT></SPAN></DIV>
<BLOCKQUOTE>
<DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
size=3D2>-----Original Message-----<BR><B>From:</B> OLEDB_DEV=20
[mailto:[email protected]]<B>On Behalf Of </B>Erik=20
Valdes<BR><B>Sent:</B> Thursday, January 09, 2003 4:05 =
PM<BR><B>To:</B>=20
[email protected]<BR><B>Subject:</B> Re: [OLEDB_DEV] AW:=20
[OLEDB_DEV] OLE 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">Hi Duncan,=20
</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> </P>
<P class=3DMsoNormal><FONT face=3DArial color=3Dnavy size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">You've gone =
one step=20
further than I expected. I'm not sure I understand the relevance =
of who=20
owns the memory. However, I had not tried using DBTYPE_BYREF at =
all so=20
that is something I need to try. Why is the memory owner =
important for=20
this issue?</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> </P>
<P class=3DMsoNormal><FONT face=3DArial color=3Dnavy size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: =
Arial">Thanks,</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">Erik</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> </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> =
Duncan=20
Smith [mailto:[email protected]] <BR><B><SPAN=20
style=3D"FONT-WEIGHT: bold">Sent:</SPAN></B> </SPAN></FONT><FONT =
face=3DTahoma=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Tahoma">Thursday, January=20
09, 2003</SPAN></FONT><FONT face=3DTahoma size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> </SPAN></FONT><FONT =
face=3DTahoma=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">1:21=20
PM</SPAN></FONT><FONT face=3DTahoma size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"><BR><B><SPAN=20
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] AW: =
[OLEDB_DEV]=20
OLE DB Consumer 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> </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 encountered this exact =
issue. I=20
wanted to pass a string buffer containing XML data to the provider =
using=20
client-owned memory. The OLE DB data type I use is DBTYPE_STR | =
DBTYPE_BYREF.=20
Using the standard OLE DB consumer template macros will result in this =
being=20
provider-owned memory (see CAccessorBase::Bind in atldbcli.h). So I =
created my=20
own CAccessorBase type class (called CAccessorBaseEx below) with 2 =
static=20
methods and created my own bind macro as follows:</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
color=3Dnavy=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: =
Arial"></SPAN></FONT> </P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
color=3Dgreen size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">// =
This=20
macro is to be used in place of _COLUMN_ENTRY_CODE (in atldbcli.h) for =
a=20
parameter or</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
color=3Dgreen size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">// =
column=20
whose type has the DBTYPE_BYREF bit set. CAccessorBase::Bind always =
sets=20
dwMemOwner</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
color=3Dgreen size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">// =
to=20
DBMEMOWNER_PROVIDEROWNED if the DBTYPE_BYREF bit set. This macro =
changes that=20
behavior by</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
color=3Dgreen size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">// =
setting=20
dwMemOwner to the value passed as the last macro =
parameter.</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
color=3Dgreen size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">// =
Use=20
COLUMN_ENTRY_EX_BYREF instead of COLUMN_ENTRY_EX (in atldbcli.h) for=20
DBTYPE_BYREF entries.</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
color=3Dblue size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier =
New'">#define</SPAN></FONT><FONT=20
face=3D"Courier New" size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">=20
_COLUMN_ENTRY_CODE_BYREF(nOrdinal, wType, nLength, nPrecision, nScale, =
dataOffset, lengthOffset, statusOffset, dwMemOwner) =
\</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
<FONT color=3Dblue><SPAN style=3D"COLOR: blue">if</SPAN></FONT> =
(pBuffer !=3D NULL)=20
\</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
{ \</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
<FONT color=3Dblue><SPAN style=3D"COLOR: blue">if</SPAN></FONT> =
(!bClearOnly)=20
\</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
CAccessorBaseEx::FreeType(wType, pBuffer + dataOffset, dwMemOwner);=20
\</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
memset(pBuffer + dataOffset, 0, nLength); \</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
} \</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
<FONT color=3Dblue><SPAN style=3D"COLOR: blue">else</SPAN></FONT> =
<FONT=20
color=3Dblue><SPAN style=3D"COLOR: blue">if</SPAN></FONT> (pBinding =
!=3D NULL)=20
\</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
{ \</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
ATLASSERT( pColumnNames !=3D NULL ); \</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
*pColumnNames =3D NULL; \</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
CAccessorBaseEx::Bind(pBinding, nOrdinal, wType, nLength, nPrecision, =
nScale,=20
eParamIO, \</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
dataOffset, lengthOffset, statusOffset, NULL, dwMemOwner); =
\</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
pColumnNames++; \</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
pBinding++; \</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
} \</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
nColumns++;</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"></SPAN></FONT> </P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
color=3Dblue size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier =
New'">#define</SPAN></FONT><FONT=20
face=3D"Courier New" size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">=20
COLUMN_ENTRY_EX_BYREF(nOrdinal, wType, nLength, nPrecision, nScale, =
data,=20
length, status, dwMemOwner) \</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
_COLUMN_ENTRY_CODE_BYREF(nOrdinal, wType, nLength, nPrecision, nScale, =
offsetbuf(data), offsetbuf(length), offsetbuf(status),=20
dwMemOwner)</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
color=3Dnavy=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: =
Arial"></SPAN></FONT> </P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
color=3Dnavy=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: =
Arial"></SPAN></FONT> </P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
color=3Dblue size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier =
New'">class</SPAN></FONT><FONT=20
face=3D"Courier New" size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">=20
CAccessorBaseEx</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'">{</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
color=3Dblue size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier =
New'">public</SPAN></FONT><FONT=20
face=3D"Courier New" size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'">:</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
<FONT color=3Dblue><SPAN style=3D"COLOR: blue">static</SPAN></FONT> =
<FONT=20
color=3Dblue><SPAN style=3D"COLOR: blue">void</SPAN></FONT> =
Bind(DBBINDING*=20
pBinding, ULONG nOrdinal, DBTYPE wType,</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
ULONG nLength, BYTE nPrecision, BYTE nScale, DBPARAMIO=20
eParamIO,</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
ULONG nDataOffset, ULONG nLengthOffset =3D NULL, ULONG nStatusOffset =
=3D=20
NULL,</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
DBOBJECT* pdbobject =3D NULL, DBMEMOWNER dwMemOwner =3D =
DBMEMOWNER_CLIENTOWNED)=20
<FONT color=3Dblue><SPAN=20
style=3D"COLOR: blue">throw</SPAN></FONT>()</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
{</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
ATL::CAccessorBase::Bind(</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
pBinding,</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
nOrdinal,</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
wType,</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
nLength,</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
nPrecision,</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
nScale,</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
eParamIO,</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
nDataOffset,</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
nLengthOffset,</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
nStatusOffset,</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
pdbobject);</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"></SPAN></FONT> </P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
pBinding->dwMemOwner =3D dwMemOwner;</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
}</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"></SPAN></FONT> </P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
<FONT color=3Dblue><SPAN style=3D"COLOR: blue">static</SPAN></FONT> =
<FONT=20
color=3Dblue><SPAN style=3D"COLOR: blue">inline</SPAN></FONT> <FONT=20
color=3Dblue><SPAN style=3D"COLOR: blue">void</SPAN></FONT> =
FreeType(DBTYPE wType,=20
BYTE* pValue, DBMEMOWNER dwMemOwner) <FONT color=3Dblue><SPAN=20
style=3D"COLOR: blue">throw</SPAN></FONT>()</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
{</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
<FONT color=3Dblue><SPAN style=3D"COLOR: blue">if</SPAN></FONT> =
((wType &=20
DBTYPE_BYREF) && (dwMemOwner =3D=3D=20
DBMEMOWNER_CLIENTOWNED))</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
{</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
<FONT color=3Dblue><SPAN style=3D"COLOR: blue">void</SPAN></FONT> * =
pData =3D=20
*(<FONT color=3Dblue><SPAN style=3D"COLOR: blue">void</SPAN></FONT>=20
**)pValue;</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"></SPAN></FONT> </P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
<FONT color=3Dblue><SPAN style=3D"COLOR: blue">if</SPAN></FONT> (pData =
!=3D=20
NULL)</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
CoTaskMemFree(pData);</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
}</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =
<FONT color=3Dblue><SPAN=20
style=3D"COLOR: blue">else</SPAN></FONT></SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> &=
nbsp; =20
ATL::CAccessorBase::FreeType(wType, pValue);</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
}</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
color=3Dnavy=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: =
Arial">};</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
color=3Dnavy=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: navy; 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">Then the accessor I used =
has the=20
following (the SQL Server data type I am using is =
text):</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
color=3Dnavy=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: =
Arial"></SPAN></FONT> </P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
<FONT color=3Dblue><SPAN style=3D"COLOR: blue">char</SPAN></FONT>=20
* m_pszData;</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
DBLENGTH m_DataLength;</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"> =20
DBSTATUS m_DataStatus;</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'">...</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in; TEXT-INDENT: =
0.5in"><FONT=20
face=3D"Courier New" size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'">COLUMN_ENTRY_EX_BYREF(5,=20
DBTYPE_STR | DBTYPE_BYREF, <FONT color=3Dblue><SPAN=20
style=3D"COLOR: blue">sizeof</SPAN></FONT>(<FONT color=3Dblue><SPAN=20
style=3D"COLOR: blue">char</SPAN></FONT> *), 0, 0, m_pszData, =
m_DataLength,=20
m_DataStatus, DBMEMOWNER_CLIENTOWNED)</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT =
face=3D"Courier New"=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"></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">Hope this =
helps.</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">Duncan =
Smith</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
color=3Dnavy=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: =
Arial"></SPAN></FONT> </P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 0.5in"><FONT face=3DArial =
color=3Dnavy=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: =
Arial"></SPAN></FONT> </P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 1in"><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> =
Erik=20
Valdes [mailto:[email protected]] <BR><B><SPAN=20
style=3D"FONT-WEIGHT: bold">Sent:</SPAN></B> </SPAN></FONT><FONT =
face=3DTahoma=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Tahoma">Thursday, January=20
09, 2003</SPAN></FONT><FONT face=3DTahoma size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> </SPAN></FONT><FONT =
face=3DTahoma=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">1:17=20
PM</SPAN></FONT><FONT face=3DTahoma size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"><BR><B><SPAN=20
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] AW: =
[OLEDB_DEV]=20
OLE DB Consumer Templates</SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 1in"><FONT face=3D"Times =
New Roman"=20
size=3D3><SPAN style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P style=3D"MARGIN-LEFT: 1in"><FONT face=3D"Times New Roman" =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">Hi,</SPAN></FONT> </P>
<P style=3D"MARGIN-LEFT: 1in"><FONT face=3D"Times New Roman" =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">I see what you mean about MS recommending =
the storage=20
object way. I've found a lot of articles describing that. =
However,=20
I'm having trouble finding anything that gives an example of how to do =
the=20
in-memory way. Perhaps someone could point me to an example or a =
how-to=20
document? I'd really appreciate it. </SPAN></FONT></P>
<P style=3D"MARGIN-LEFT: 1in"><FONT face=3D"Times New Roman" =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">Thanks,</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">Erik</SPAN></FONT> </P>
<P style=3D"MARGIN-LEFT: 1in"><FONT face=3D"Times New Roman" =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">-----Original Message-----</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">From: Yuancai Ye [<A=20
href=3D"mailto:[email protected]">mailto:[email protected]</A>]=20
</SPAN></FONT><BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">Sent: =
</SPAN></FONT><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">Thursday, =
January 09,=20
2003</SPAN></FONT><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">=20
</SPAN></FONT><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">9:57 =
AM</SPAN></FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">To:=20
[email protected]</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">Subject: Re: [OLEDB_DEV] AW: [OLEDB_DEV] OLE =
DB=20
Consumer Templates</SPAN></FONT> </P>
<P style=3D"MARGIN-LEFT: 1in"><FONT face=3D"Times New Roman" =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">Hi,</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt"> MS recommends us to use =
storage=20
object for sending</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">a BLOB into a data source. However, as I =
tested,=20
this</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">way is bad=20
in many cases since your code needs to</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">create a store object and database needs to=20
recover</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">binnary=20
data from the store object. You'd better use</SPAN></FONT> <BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">in-memory way to send BLOB =
for faster=20
speed. With use</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">of in-memory way, the previous two extra =
steps=20
are</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">avoided.=20
Therefore, in-memory way is faster. That is</SPAN></FONT> <BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">my guess. Test it =
yourself.</SPAN></FONT>=20
</P>
<P style=3D"MARGIN-LEFT: 1in"><FONT face=3D"Times New Roman" =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">Regards,</SPAN></FONT> </P>
<P style=3D"MARGIN-LEFT: 1in"><FONT face=3D"Times New Roman" =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">Yuancai (Charlie) Ye</SPAN></FONT> </P>
<P style=3D"MARGIN-LEFT: 1in"><FONT face=3D"Times New Roman" =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">--- Rudolf Wiener <[email protected]>=20
wrote:</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">>=20
Erik,</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> For reading and writing blobs, which is =
what=20
you're</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">> in=20
fact using, I use the</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> technologies recommended and stream the =
data with=20
a</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">> storage=20
object. The</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">>=20
macro I use in the accessor is</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> BLOB_ENTRY_LENGTH_STATUS. I'm not sure=20
if</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">> this is=20
the best way to do it because I have the</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> impression it slows =
things</SPAN></FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> down a bit. =
But I haven't=20
had the time yet to look</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> into faster alternatives.</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> If you like I can send you excerpts =
from my=20
app's</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">>=20
code.</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> Regards</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> Rudi</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> =
-----Urspr&#40689;gliche=20
Nachricht-----</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> Von: =
OLEDB_DEV</SPAN></FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> [<A=20
=
href=3D"mailto:[email protected]">mailto:[email protected]=
velop.com</A>]Im=20
Auftrag von</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">>=20
Erik</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">>=20
Valdes</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> Gesendet: Donnerstag, 09.=20
J&#37592;ner 2003 </SPAN></FONT><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">17:22</SPAN></FONT> <BR><FONT size=3D2><SPAN =
style=3D"FONT-SIZE: 10pt">> An:=20
[email protected]</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> Betreff: Re: [OLEDB_DEV] =
OLE DB=20
Consumer Templates</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> The reason I can't allocate =
on the=20
stack is that</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> my variable can be any</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> length. It =
essentially boils=20
down to the string</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> representation of an xml</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> file. That file =
can be any=20
size. When I pass it to</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> my SP, the sp's</SPAN></FONT> <BR><FONT =
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> parameter is ntext (to =
allow for any=20
size). What</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> do people do when they</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> want to pass XML of =
unknown length=20
to a SQL Server</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> stored procedure?</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> -----Original=20
Message-----</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> From: Peter Moss [<A=20
=
href=3D"mailto:[email protected]">mailto:[email protected]</A>]</SPAN></FON=
T>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> =
Sent:=20
</SPAN></FONT><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">Thursday, =
January 09,=20
2003</SPAN></FONT><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">=20
</SPAN></FONT><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">7:58 =
AM</SPAN></FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> =
To:=20
[email protected]</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> Subject: Re: [OLEDB_DEV] =
OLE DB=20
Consumer Templates</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> If I remember right, you =
can't use=20
the macros for</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> heap-allocated</SPAN></FONT> <BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> variables. If you =
dig into the=20
macro definitions, I</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> believe you will find</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> that pointers offset =
from the=20
beginning of 'this'</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> are used. Thus, a</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> heap-allocated variable =
like=20
m_WorkRequest will not</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> work.</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> Why can't you just allocate =
a TCHAR=20
on the stack</SPAN></FONT> <BR><FONT size=3D2><SPAN =
style=3D"FONT-SIZE: 10pt">>=20
frame of the object, ie,</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> TCHAR=20
m_WorkRequest[257]; // Or 1 + the =
size</SPAN></FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> of your SP =
parameter=20
size</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> Then you can just use=20
COLUMN_ENTRY.</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> HTH,</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> Peter</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> -----Original=20
Message-----</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> From:=20
OLEDB_DEV</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">>=20
[<A=20
=
href=3D"mailto:[email protected]">mailto:[email protected]=
VELOP.COM</A>]On=20
Behalf Of</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">>=20
Erik</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">>=20
Valdes</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> Sent: =
</SPAN></FONT><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">Wednesday, January 08,=20
2003</SPAN></FONT><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">=20
</SPAN></FONT><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">5:22 =
PM</SPAN></FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">> =20
To: [email protected]</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> Subject: =
[OLEDB_DEV] OLE=20
DB Consumer Templates</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> I'm having =
trouble=20
implementing an accessor.</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> I'm trying to use a</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> variable (m_WorkRequest) =
that's=20
dynamically</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">>=20
allocated as the variable that's</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> bound to a parameter in my accessor =
(commented=20
line</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">>=20
below). The reason I</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> need it to be dynamic is that it is XML =
and can=20
be</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">> any=20
length. The stored</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> proc's parameter is of ntext type to =
handle=20
the</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">> variable=20
length. However, I</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> don't know at compile time how big to =
make=20
the</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">> buffer=20
for my parameter in my</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> accessor. What's the proper way =
to do=20
this? I've</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> tried COLUMN_ENTRY</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> (access violation),=20
COLUMN_ENTRY_LENGTH (different</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> variations produce</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> different errors, but =
basically I=20
can't set the</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> length),</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> COLUMN_ENTRY_TYPE_SIZE (similar =
problems as=20
the</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">>=20
previous). I'm running out</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> of ideas now. The code below is =
just one of=20
many,</SPAN></FONT> <BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: =
10pt">> many=20
variations I've</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> tried.</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> class=20
CAddWorkRequest</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> {</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> =
public:</SPAN></FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> =20
CAddWorkRequest() STD_INIT</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> =20
~CAddWorkRequest()</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> =20
{</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> =20
if (m_WorkRequest)</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> &nb=
sp; =20
delete [] m_WorkRequest;</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> =20
}</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> LONG=20
m_RETURNVALUE;</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> LPTSTR=20
m_WorkRequest;</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> LONG=20
m_lLength;</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> void=20
SetStringParam(LPCTSTR szString,int</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> cBytes)</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> =20
{</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> =20
m_WorkRequest =3D (LPTSTR) new</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> TCHAR[cBytes];</SPAN></FONT> <BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> =20
_tcsncpy(m_WorkRequest,szString,cBytes);</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> =20
m_lLength =3D _tcslen(m_WorkRequest);</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> =20
})</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> =20
BEGIN_PARAM_MAP(CAddWorkRequest)</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> =20
SET_PARAM_TYPE(DBPARAMIO_OUTPUT)</SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> =20
COLUMN_ENTRY(1, m_RETURNVALUE)</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">> =20
SET_PARAM_TYPE(DBPARAMIO_INPUT)</SPAN></FONT> <BR><FONT size=3D2><SPAN =
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> =
//</SPAN></FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">COLUMN_ENTRY_TYPE_SIZE(2,DBTYPE_STR,_tcslen(m_WorkRequest),</SPAN><=
/FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">>=20
m_WorkRequest)</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> =20
END_PARAM_MAP()</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> =20
DEFINE_COMMAND(CAddWorkRequest, _T("{ ? =3D CALL</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> =
dbo.AddWorkRequest;1</SPAN></FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> (?) =
}"))</SPAN></FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> =
};</SPAN></FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> class=20
CAddWorkRequestCommand : public</SPAN></FONT> <BR><FONT size=3D2><SPAN =
style=3D"FONT-SIZE: 10pt">> =
CBsDbCommand<CAddWorkRequest></SPAN></FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">> =20
{</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> =
};</SPAN></FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> foo (LPTSTR=20
szWor)</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">> {</SPAN></FONT> =
<BR><FONT=20
size=3D2><SPAN style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">></SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">=3D=3D=3D message truncated =
=3D=3D=3D</SPAN></FONT> </P>
<P class=3DMsoNormal style=3D"MARGIN-LEFT: 1in"><FONT face=3D"Times =
New Roman"=20
size=3D3><SPAN style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P style=3D"MARGIN-LEFT: 1in"><FONT face=3D"Times New Roman" =
size=3D2><SPAN=20
style=3D"FONT-SIZE: =
10pt">__________________________________________________</SPAN></FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">Do you =
Yahoo!?</SPAN></FONT>=20
<BR><FONT size=3D2><SPAN style=3D"FONT-SIZE: 10pt">Yahoo! Mail Plus - =
Powerful.=20
Affordable. Sign up now.</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt"><A href=3D"http://mailplus.yahoo.com"=20
target=3D_blank>http://mailplus.yahoo.com</A></SPAN></FONT> </P>
<P style=3D"MARGIN-LEFT: 1in"><FONT face=3D"Times New Roman" =
size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">You can read messages from the OLEDB_DEV =
archive,=20
unsubscribe from OLEDB_DEV,</SPAN></FONT> <BR><FONT size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt">or subscribe to other DevelopMentor lists at =
<A=20
href=3D"http://discuss.develop.com"=20
target=3D_blank>http://discuss.develop.com</A>.</SPAN></FONT> =
</P></DIV>You can=20
read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV, =
or=20
subscribe to other DevelopMentor lists at http://discuss.develop.com. =
You can=20
read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV, =
or=20
subscribe to other DevelopMentor lists at You can read messages from =
the=20
OLEDB_DEV archive, unsubscribe from OLEDB_DEV, or subscribe to other=20
DevelopMentor lists at http://discuss.develop.com.=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_000_0057_01C2B7FA.2C08DAC0--