Re: AW: [OLEDB_DEV] OLE DB Consumer Templates
Duncan Smith <[email protected]> Fri, 10 Jan 2003 09:26:38 -0500
| Newsgroups | gmane.comp.windows.devel.oledb.devel |
|---|---|
| Message-ID | <[email protected]> |
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C2B8B3.DC8149B4 Content-Type: text/plain Erik, I'm using ATL which comes with Microsoft Visual Studio .NET. You will need to adjust the macros for earlier versions of ATL. Look at ATL's _COLUMN_ENTRY_CODE macro in atldbcli.h - the one I sent is very similar to that one. Duncan -----Original Message----- From: Erik Valdes [mailto:[email protected]] Sent: Thursday, January 09, 2003 5:25 PM To: [email protected] Subject: Re: [OLEDB_DEV] AW: [OLEDB_DEV] OLE DB Consumer Templates Hi Duncan, I'm getting compilation errors. Where are bClearOnly and pColumnNames coming from? Erik -----Original Message----- From: Duncan Smith [mailto:[email protected]] Sent: Thursday, January 09, 2003 2:17 PM To: [email protected] Subject: Re: [OLEDB_DEV] AW: [OLEDB_DEV] OLE DB Consumer Templates Hi Erik, According to the OLE DB documentation for the DBBINDING dwMemOwner field: "For bindings in parameter accessors, consumer-owned memory must always be used." I also use the same type of accessor entry (COLUMN_ENTRY_EX_BYREF(n, DBTYPE_STR | DBTYPE_BYREF...)) when getting a rowset containing a column with the XML data. For bindings in row accessors, it gives the client control over when the memory is to be freed. Duncan -----Original Message----- From: Erik Valdes [mailto:[email protected]] 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] <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] <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] <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] <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 <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 <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. 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. 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_01C2B8B3.DC8149B4 Content-Type: text/html Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" = xmlns=3D"http://www.w3.org/TR/REC-html40"> <head> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Dus-ascii"> <meta name=3DProgId content=3DWord.Document> <meta name=3DGenerator content=3D"Microsoft Word 10"> <meta name=3DOriginator content=3D"Microsoft Word 10"> <link rel=3DFile-List href=3D"cid:[email protected]"> <title>RE: [OLEDB_DEV] AW: [OLEDB_DEV] OLE DB Consumer = Templates</title> <o:SmartTagType = namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" name=3D"City"/> <o:SmartTagType = namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" name=3D"place"/> <!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:DoNotRelyOnCSS/> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:SpellingState>Clean</w:SpellingState> <w:GrammarState>Clean</w:GrammarState> <w:DocumentKind>DocumentEmail</w:DocumentKind> <w:EnvelopeVis/> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if !mso]> <style> st1\:*{behavior:url(#default#ieooui) } </style> <![endif]--> <style> <!-- /* Font Definitions */ @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:1627421319 -2147483648 8 0 66047 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:blue; text-decoration:underline; text-underline:single;} p {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} span.emailstyle18 {mso-style-name:emailstyle18; font-family:Arial; mso-ascii-font-family:Arial; mso-hansi-font-family:Arial; mso-bidi-font-family:Arial; color:navy;} span.emailstyle19 {mso-style-name:emailstyle19; font-family:Arial; mso-ascii-font-family:Arial; mso-hansi-font-family:Arial; mso-bidi-font-family:Arial; color:navy;} span.emailstyle20 {mso-style-name:emailstyle20; font-family:Arial; mso-ascii-font-family:Arial; mso-hansi-font-family:Arial; mso-bidi-font-family:Arial; color:navy;} span.emailstyle21 {mso-style-name:emailstyle21; font-family:Arial; mso-ascii-font-family:Arial; mso-hansi-font-family:Arial; mso-bidi-font-family:Arial; color:navy;} span.EmailStyle22 {mso-style-type:personal-reply; mso-style-noshow:yes; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt; font-family:Arial; mso-ascii-font-family:Arial; mso-hansi-font-family:Arial; mso-bidi-font-family:Arial; color:navy;} span.SpellE {mso-style-name:""; mso-spl-e:yes;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */=20 table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman";} </style> <![endif]--> </head> <body lang=3DEN-US link=3Dblue vlink=3Dblue = style=3D'tab-interval:.5in'> <div class=3DSection1> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'>Erik,<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>= <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'>I'm using ATL which comes with Microsoft Visual Studio .NET. You will need to adjust the macros for = earlier versions of ATL. Look at <span class=3DSpellE>ATL's</span> = _COLUMN_ENTRY_CODE macro in <span class=3DSpellE>atldbcli.h</span> - the one I sent is = very similar to that one.<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>= <p class=3DMsoNormal><st1:City><st1:place><font size=3D2 color=3Dnavy = face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Duncan</span></f= ont></st1:place></st1:City><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial; color:navy'><o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>= <p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 = face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original = Message-----<br> <b><span style=3D'font-weight:bold'>From:</span></b> Erik Valdes [mailto:[email protected]] <br> <b><span style=3D'font-weight:bold'>Sent:</span></b> Thursday, January = 09, 2003 5:25 PM<br> <b><span style=3D'font-weight:bold'>To:</span></b> = [email protected]<br> <b><span style=3D'font-weight:bold'>Subject:</span></b> Re: [OLEDB_DEV] = AW: [OLEDB_DEV] OLE DB Consumer Templates</span></font></p> <p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 = face=3D"Times New Roman"><span style=3D'font-size:12.0pt'><o:p> </o:p></span></font></p> <p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 = color=3Dnavy face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Hi = Duncan,</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 = color=3Dnavy face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial;color:navy'> </span></f= ont><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 = color=3Dnavy face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial;color:navy'>I'm getting = compilation errors. Where are bClearOnly and pColumnNames coming = from?</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 = color=3Dnavy face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial;color:navy'> </span></f= ont><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 = color=3Dnavy face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Erik</span></fon= t><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 = color=3Dnavy face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial;color:navy'> </span></f= ont><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.0in'><font size=3D2 = face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original = Message-----<br> <b><span style=3D'font-weight:bold'>From:</span></b> Duncan Smith [mailto:[email protected]] <br> <b><span style=3D'font-weight:bold'>Sent:</span></b> Thursday, January = 09, 2003 2:17 PM<br> <b><span style=3D'font-weight:bold'>To:</span></b> = [email protected]<br> <b><span style=3D'font-weight:bold'>Subject:</span></b> Re: [OLEDB_DEV] = AW: [OLEDB_DEV] OLE DB Consumer Templates</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.0in'><font size=3D3 = face=3D"Times New Roman"><span style=3D'font-size:12.0pt'> <o:p></o:p></span></font></p> <p class=3DMsoNormal style=3D'margin-left:1.0in'><font size=3D2 = face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'>Hi = Erik,</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.0in'><font size=3D2 = face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'> </span></font><o:p></= o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.0in'><font size=3D2 = face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'>According to the OLE DB documentation for the DBBINDING dwMemOwner field: "For bindings in parameter accessors, consumer-owned memory must always be = used."</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.0in'><font size=3D2 = face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'> </span></font><o:p></= o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.0in'><font size=3D2 = face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'>I also use the same type = of accessor entry (COLUMN_ENTRY_EX_BYREF(n, DBTYPE_STR | DBTYPE_BYREF...)) when = getting a rowset containing a column with the XML data. For bindings in row = accessors, it gives the client control over when the memory is to be = freed.</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.0in'><font size=3D2 = face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'> </span></font><o:p></= o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.0in'><font size=3D2 = face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'>Duncan</span></font><o:p></= o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.0in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'> </span></f= ont><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.5in'><font size=3D2 = face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original = Message-----<br> <b><span style=3D'font-weight:bold'>From:</span></b> Erik Valdes [mailto:[email protected]] <br> <b><span style=3D'font-weight:bold'>Sent:</span></b> Thursday, January = 09, 2003 4:05 PM<br> <b><span style=3D'font-weight:bold'>To:</span></b> = [email protected]<br> <b><span style=3D'font-weight:bold'>Subject:</span></b> Re: [OLEDB_DEV] = AW: [OLEDB_DEV] OLE DB Consumer Templates</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.5in'><font size=3D3 = face=3D"Times New Roman"><span style=3D'font-size:12.0pt'> <o:p></o:p></span></font></p> <p class=3DMsoNormal style=3D'margin-left:1.5in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Hi Duncan, </span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.5in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'> </span></f= ont><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.5in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'>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?</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.5in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'> </span></f= ont><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.5in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Thanks,</span></= font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.5in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Erik</span></fon= t><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:1.5in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'> </span></f= ont><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.0in'><font size=3D2 = face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original = Message-----<br> <b><span style=3D'font-weight:bold'>From:</span></b> Duncan Smith [mailto:[email protected]] <br> <b><span style=3D'font-weight:bold'>Sent:</span></b> Thursday, January = 09, 2003 1:21 PM<br> <b><span style=3D'font-weight:bold'>To:</span></b> = [email protected]<br> <b><span style=3D'font-weight:bold'>Subject:</span></b> Re: [OLEDB_DEV] = AW: [OLEDB_DEV] OLE DB Consumer Templates</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.0in'><font size=3D3 = face=3D"Times New Roman"><span style=3D'font-size:12.0pt'> <o:p></o:p></span></font></p> <p class=3DMsoNormal style=3D'margin-left:2.0in'><font size=3D2 = face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'>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:</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.0in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'> </span></f= ont><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 color=3Dgreen face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"; color:green'>// This macro is to be used in place of _COLUMN_ENTRY_CODE = (in atldbcli.h) for a parameter or</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 color=3Dgreen face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"; color:green'>// column whose type has the DBTYPE_BYREF bit set. CAccessorBase::Bind always sets dwMemOwner</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 color=3Dgreen face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"; color:green'>// to DBMEMOWNER_PROVIDEROWNED if the DBTYPE_BYREF bit = set. This macro changes that behavior by</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 color=3Dgreen face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"; color:green'>// setting dwMemOwner to the value passed as the last = macro parameter.</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 color=3Dgreen face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"; color:green'>// Use COLUMN_ENTRY_EX_BYREF instead of COLUMN_ENTRY_EX = (in atldbcli.h) for DBTYPE_BYREF entries.</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 color=3Dblue face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"; color:blue'>#define</span></font><font size=3D2 face=3D"Courier = New"><span style=3D'font-size:10.0pt;font-family:"Courier New"'> _COLUMN_ENTRY_CODE_BYREF(nOrdinal, wType, nLength, nPrecision, nScale, dataOffset, lengthOffset, statusOffset, dwMemOwner) = \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> <font color=3Dblue><span style=3D'color:blue'>if</span></font> (pBuffer = !=3D NULL) \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> { \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = <font color=3Dblue><span style=3D'color:blue'>if</span></font> = (!bClearOnly) \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = CAccessorBaseEx::FreeType(wType, pBuffer + dataOffset, dwMemOwner); = \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = memset(pBuffer + dataOffset, 0, nLength); = \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> } \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> <font color=3Dblue><span style=3D'color:blue'>else</span></font> <font = color=3Dblue><span style=3D'color:blue'>if</span></font> (pBinding !=3D NULL) = \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> { \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = ATLASSERT( pColumnNames !=3D NULL ); \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = *pColumnNames =3D NULL; \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = CAccessorBaseEx::Bind(pBinding, nOrdinal, wType, nLength, nPrecision, = nScale, eParamIO, \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = dataOffset, lengthOffset, statusOffset, NULL, dwMemOwner); = \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = pColumnNames++; \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = pBinding++; \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> } \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> nColumns++;</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> </span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 color=3Dblue face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"; color:blue'>#define</span></font><font size=3D2 face=3D"Courier = New"><span style=3D'font-size:10.0pt;font-family:"Courier New"'> COLUMN_ENTRY_EX_BYREF(nOrdinal, wType, nLength, nPrecision, nScale, = data, length, status, dwMemOwner) \</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> _COLUMN_ENTRY_CODE_BYREF(nOrdinal, wType, nLength, nPrecision, nScale, offsetbuf(data), offsetbuf(length), offsetbuf(status), = dwMemOwner)</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.0in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'> </span></f= ont><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.0in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'> </span></f= ont><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 color=3Dblue face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"; color:blue'>class</span></font><font size=3D2 face=3D"Courier = New"><span style=3D'font-size:10.0pt;font-family:"Courier New"'> = CAccessorBaseEx</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'>{</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 color=3Dblue face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"; color:blue'>public</span></font><font size=3D2 face=3D"Courier = New"><span style=3D'font-size:10.0pt;font-family:"Courier = New"'>:</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> <font color=3Dblue><span style=3D'color:blue'>static</span></font> = <font color=3Dblue><span style=3D'color:blue'>void</span></font> = Bind(DBBINDING* pBinding, ULONG nOrdinal, DBTYPE wType,</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = ULONG nLength, BYTE nPrecision, BYTE nScale, DBPARAMIO = eParamIO,</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = ULONG nDataOffset, ULONG nLengthOffset =3D NULL, ULONG nStatusOffset = =3D NULL,</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = DBOBJECT* pdbobject =3D NULL, DBMEMOWNER dwMemOwner =3D = DBMEMOWNER_CLIENTOWNED) <font color=3Dblue><span = style=3D'color:blue'>throw</span></font>()</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> {</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = ATL::CAccessorBase::Bind(</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = pBinding,</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = nOrdinal,</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = wType,</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = nLength,</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = nPrecision,</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = nScale,</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = eParamIO,</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = = nDataOffset,</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = nLengthOffset,</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = nStatusOffset,</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = pdbobject);</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> </span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = pBinding->dwMemOwner =3D dwMemOwner;</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier New"'> &= nbsp; }</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> </span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> <font color=3Dblue><span style=3D'color:blue'>static</span></font> = <font color=3Dblue><span style=3D'color:blue'>inline</span></font> <font = color=3Dblue><span style=3D'color:blue'>void</span></font> FreeType(DBTYPE wType, BYTE* = pValue, DBMEMOWNER dwMemOwner) <font color=3Dblue><span = style=3D'color:blue'>throw</span></font>()</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> {</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = <font color=3Dblue><span style=3D'color:blue'>if</span></font> ((wType = & DBTYPE_BYREF) && (dwMemOwner =3D=3D = DBMEMOWNER_CLIENTOWNED))</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = {</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = <font color=3Dblue><span style=3D'color:blue'>void</span></font> * = pData =3D *(<font color=3Dblue><span style=3D'color:blue'>void</span></font> = **)pValue;</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> </span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = <font color=3Dblue><span style=3D'color:blue'>if</span></font> (pData = !=3D NULL)</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = = CoTaskMemFree(pData);</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = }</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = <font color=3Dblue><span = style=3D'color:blue'>else</span></font></span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> = ATL::CAccessorBase::FreeType(wType, = pValue);</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span style=3D'font-size:10.0pt;font-family:"Courie= r New"'> }</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.0in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'>};</span></font>= <o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.0in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'> </span></f= ont><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.0in'><font size=3D2 = face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'>Then the accessor I used = has the following (the SQL Server data type I am using is = text):</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.0in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'> </span></f= ont><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> <font color=3Dblue><span style=3D'color:blue'>char</span></font> * m_pszData;</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> DBLENGTH m_DataLength;</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> DBSTATUS m_DataStatus;</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'>...</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-indent:.5in;text-autospace: none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family: "Courier New"'>COLUMN_ENTRY_EX_BYREF(5, DBTYPE_STR | DBTYPE_BYREF, = <font color=3Dblue><span style=3D'color:blue'>sizeof</span></font>(<font = color=3Dblue><span style=3D'color:blue'>char</span></font> *), 0, 0, m_pszData, = m_DataLength, m_DataStatus, DBMEMOWNER_CLIENTOWNED)</span></font><o:p></o:p></p> <p class=3DMsoNormal = style=3D'margin-left:2.0in;text-autospace:none'><font size=3D2 face=3D"Courier New"><span = style=3D'font-size:10.0pt;font-family:"Courier = New"'> </span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.0in'><font size=3D2 = face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'>Hope this = helps.</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.0in'><font size=3D2 = face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'>Duncan = Smith</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.0in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'> </span></f= ont><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.0in'><font size=3D2 = color=3Dnavy face=3DArial><span = style=3D'font-size:10.0pt;font-family:Arial;color:navy'> </span></f= ont><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.5in'><font size=3D2 = face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original = Message-----<br> <b><span style=3D'font-weight:bold'>From:</span></b> Erik Valdes [mailto:[email protected]] <br> <b><span style=3D'font-weight:bold'>Sent:</span></b> Thursday, January = 09, 2003 1:17 PM<br> <b><span style=3D'font-weight:bold'>To:</span></b> = [email protected]<br> <b><span style=3D'font-weight:bold'>Subject:</span></b> Re: [OLEDB_DEV] = AW: [OLEDB_DEV] OLE DB Consumer Templates</span></font><o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.5in'><font size=3D3 = face=3D"Times New Roman"><span style=3D'font-size:12.0pt'> <o:p></o:p></span></font></p> <p style=3D'margin-left:2.5in'><font size=3D2 face=3D"Times New = Roman"><span style=3D'font-size:10.0pt'>Hi,</span></font> <o:p></o:p></p> <p style=3D'margin-left:2.5in'><font size=3D2 face=3D"Times New = Roman"><span style=3D'font-size:10.0pt'>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. = </span></font><o:p></o:p></p> <p style=3D'margin-left:2.5in'><font size=3D2 face=3D"Times New = Roman"><span style=3D'font-size:10.0pt'>Thanks,</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>Erik</span></font> = <o:p></o:p></p> <p style=3D'margin-left:2.5in'><font size=3D2 face=3D"Times New = Roman"><span style=3D'font-size:10.0pt'>-----Original Message-----</span></font> = <br> <font size=3D2><span style=3D'font-size:10.0pt'>From: Yuancai Ye [<a href=3D"mailto:[email protected]">mailto:[email protected]</a>] = </span></font><br> <font size=3D2><span style=3D'font-size:10.0pt'>Sent: Thursday, January = 09, 2003 9:57 AM</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>To: = [email protected]</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>Subject: Re: = [OLEDB_DEV] AW: [OLEDB_DEV] OLE DB Consumer Templates</span></font> <o:p></o:p></p> <p style=3D'margin-left:2.5in'><font size=3D2 face=3D"Times New = Roman"><span style=3D'font-size:10.0pt'>Hi,</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'> MS = recommends us to use storage object for sending</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>a BLOB into a data = source. However, as I tested, this</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>way is bad in many = cases since your code needs to</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>create a store object = and database needs to recover</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>binnary data from the = store object. You'd better use</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>in-memory way to send = BLOB for faster speed. With use</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>of in-memory way, the = previous two extra steps are</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>avoided. Therefore, = in-memory way is faster. That is</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>my guess. Test it = yourself.</span></font> <o:p></o:p></p> <p style=3D'margin-left:2.5in'><font size=3D2 face=3D"Times New = Roman"><span style=3D'font-size:10.0pt'>Regards,</span></font> <o:p></o:p></p> <p style=3D'margin-left:2.5in'><font size=3D2 face=3D"Times New = Roman"><span style=3D'font-size:10.0pt'>Yuancai (Charlie) Ye</span></font> = <o:p></o:p></p> <p style=3D'margin-left:2.5in'><font size=3D2 face=3D"Times New = Roman"><span style=3D'font-size:10.0pt'>--- Rudolf Wiener <[email protected]> = wrote:</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = Erik,</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> For reading and = writing blobs, which is what you're</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> in fact using, I = use the</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> technologies = recommended and stream the data with a</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> storage object. = The</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> macro I use in the = accessor is</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = BLOB_ENTRY_LENGTH_STATUS. I'm not sure if</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> this is the best = way to do it because I have the</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> impression it = slows things</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> down a bit. But I = haven't had the time yet to look</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> into faster = alternatives.</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> If you like I can = send you excerpts from my app's</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = code.</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = Regards</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> Rudi</span></font> = <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> -----Urspr&#40689;gliche Nachricht-----</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> Von: = OLEDB_DEV</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> [<a href=3D"mailto:[email protected]">mailto:[email protected]= evelop.com</a>]Im Auftrag von</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> Erik</span></font> = <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = Valdes</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = Gesendet: Donnerstag, 09. J&#37592;ner 2003 17:22</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> An: [email protected]</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = Betreff: Re: [OLEDB_DEV] OLE DB Consumer Templates</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> The = reason I can't allocate on the stack is that</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> my variable can be = any</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> length. It = essentially boils down to the string</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> representation of = an xml</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> file. That = file can be any size. When I pass it to</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> my SP, the = sp's</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> parameter is ntext = (to allow for any size). What</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> do people do when = they</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> want to pass XML = of unknown length to a SQL Server</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> stored = procedure?</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = -----Original Message-----</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> From: = Peter Moss [<a href=3D"mailto:[email protected]">mailto:[email protected]</a>]</span></fo= nt> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> Sent: = Thursday, January 09, 2003 7:58 AM</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> To: [email protected]</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = Subject: Re: [OLEDB_DEV] OLE DB Consumer Templates</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> If I = remember right, you can't use the macros for</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = heap-allocated</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> variables. = If you dig into the macro definitions, I</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> believe you will = find</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> that pointers = offset from the beginning of 'this'</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> are used. = Thus, a</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> heap-allocated = variable like m_WorkRequest will not</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = work.</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> Why = can't you just allocate a TCHAR on the stack</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> frame of the = object, ie,</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> TCHAR m_WorkRequest[257]; // Or 1 + the = size</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> of your SP = parameter size</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> Then = you can just use COLUMN_ENTRY.</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = HTH,</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = Peter</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> -----Original Message-----</span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> From: OLEDB_DEV</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> [<a href=3D"mailto:[email protected]">mailto:[email protected]= EVELOP.COM</a>]On Behalf Of</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> Erik</span></font> = <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = Valdes</span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> Sent: Wednesday, January 08, 2003 5:22 PM</span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> To: [email protected]</span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> Subject: [OLEDB_DEV] OLE DB Consumer Templates</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> I'm having trouble implementing an accessor.</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> I'm trying to use = a</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> variable = (m_WorkRequest) that's dynamically</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> allocated as the = variable that's</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> bound to a = parameter in my accessor (commented line</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = below). The reason I</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> need it to be = dynamic is that it is XML and can be</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> any length. = The stored</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> proc's parameter = is of ntext type to handle the</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> variable = length. However, I</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> don't know at = compile time how big to make the</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> buffer for my = parameter in my</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> accessor. = What's the proper way to do this? I've</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> tried = COLUMN_ENTRY</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> (access = violation), COLUMN_ENTRY_LENGTH (different</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> variations = produce</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> different errors, = but basically I can't set the</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = length),</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = COLUMN_ENTRY_TYPE_SIZE (similar problems as the</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> previous). = I'm running out</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> of ideas = now. The code below is just one of many,</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> many variations = I've</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = tried.</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> class CAddWorkRequest</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> {</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> public:</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; CAddWorkRequest() STD_INIT</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; ~CAddWorkRequest()</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; {</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; if (m_WorkRequest)</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; delete [] m_WorkRequest;</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; }</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; LONG m_RETURNVALUE;</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; LPTSTR m_WorkRequest;</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; LONG m_lLength;</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; void SetStringParam(LPCTSTR szString,int</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = cBytes)</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; {</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; m_WorkRequest =3D (LPTSTR) new</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = TCHAR[cBytes];</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; _tcsncpy(m_WorkRequest,szString,cBytes);</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; m_lLength =3D _tcslen(m_WorkRequest);</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; })</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> BEGIN_PARAM_MAP(CAddWorkRequest)</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; SET_PARAM_TYPE(DBPARAMIO_OUTPUT)</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; COLUMN_ENTRY(1, m_RETURNVALUE)</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>>  = ; SET_PARAM_TYPE(DBPARAMIO_INPUT)</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> = //</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>COLUMN_ENTRY_TYPE_SIZE(2,DBTYPE_STR,_tcslen(m= _WorkRequest),</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = m_WorkRequest)</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> END_PARAM_MAP()</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> DEFINE_COMMAND(CAddWorkRequest, _T("{ ? =3D CALL</span></font> = <br> <font size=3D2><span style=3D'font-size:10.0pt'>> = dbo.AddWorkRequest;1</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> (?) = }"))</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> = };</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> class CAddWorkRequestCommand : public</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>> CBsDbCommand<CAddWorkRequest></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> {</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> = };</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> foo (LPTSTR szWor)</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span = style=3D'font-size:10.0pt'>> {</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>></span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>=3D=3D=3D message = truncated =3D=3D=3D</span></font> <o:p></o:p></p> <p class=3DMsoNormal style=3D'margin-left:2.5in'><font size=3D3 = face=3D"Times New Roman"><span style=3D'font-size:12.0pt'> <o:p></o:p></span></font></p> <p style=3D'margin-left:2.5in'><font size=3D2 face=3D"Times New = Roman"><span style=3D'font-size:10.0pt'>_____________________________________________= _____</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>Do you = Yahoo!?</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>Yahoo! Mail Plus - = Powerful. Affordable. Sign up now.</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'><a = href=3D"http://mailplus.yahoo.com" target=3D"_blank">http://mailplus.yahoo.com</a></span></font> = <o:p></o:p></p> <p style=3D'margin-left:2.5in'><font size=3D2 face=3D"Times New = Roman"><span style=3D'font-size:10.0pt'>You can read messages from the OLEDB_DEV = archive, unsubscribe from OLEDB_DEV,</span></font> <br> <font size=3D2><span style=3D'font-size:10.0pt'>or subscribe to other = DevelopMentor lists at <a href=3D"http://discuss.develop.com" = target=3D"_blank">http://discuss.develop.com</a>.</span></font> <o:p></o:p></p> </div> </body> You can read messages from the OLEDB_DEV archive, unsubscribe from = OLEDB_DEV, or subscribe to other DevelopMentor lists at = http://discuss.develop.com. </html> 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. 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 http://discuss.develop.com. http://discuss.develop.com. ------_=_NextPart_001_01C2B8B3.DC8149B4--