Reply to Re: Problem with CCommand::Open when query str is too long.

Your name:

Reply:


Posted by Erland Sommarskog on 12/20/06 23:09

TheOne (daewon.yoon@gmail.com) writes:
> I'm using OLE DB model to insert long texts into ntext field.
> My code looks like :
>
>==
> BOOL COleDBRowData::Execute(CString strSQL)
> {
> if(!m_bIsOpen)
> return FALSE;
>
> CCommand<CNoAccessor, CNoRowset> rs;
>
> HRESULT hr = rs.Open(m_session, strSQL);
>
> if(FAILED(hr))
> return FALSE;
>
> rs.Close();
> return TRUE;
> }
>==
> When strSQL length is over 5127XX bytes, Open function fails. Is the
> function supposed to be so? Is there any suggestion that I can avoid
> this failure? I'm new to OLE DB thing.
>
> What is better is if somebody can tell me SQL command to insert a whole
> text file content into the field directly. The sql command that I'm
> currently using is
>==
> INSERT INTO MyTable(Idx, Value) Values(N'{index}', N'{loooooong
> text}')
>==

I believe that for writing LOB data, it's better to use streams.
I can't really give an example, because I have not used it myself,
and I have never used the consumer templates, only the bare OLE DB
API.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация