 |
|
 |
Dear Narayanan,
First of all, I would like to say, thank you for your contribution in here.
I am a begineer of image processing and database. I found out the above error and tried to solve it myself but still there.
I will be looking forward to hearing from your advice.
Thanks and best regards Ko Ko
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
Hi,
I was finding some information about add this kind of object to parameters using ado(msado15.dll), but i didnt get something useful, just some about appendChunk and getchunk but nothing related to add blobs to some parameter or what type it would be...adArray maybe??... something like this:
pParam1 = pCommand->CreateParameter( "@Image", adArray???, adParamInput,sizeoff(????),????);
I ll be thankfull for some comments and advices...
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
In Sybase, Field "Property" is a Image and it's size almost 16k CRecordset DoFieldExchange like: ... RFX_LongBinary(pFX, _T("[Property]"), m_Property); ...
I use it like: try { int ret = dbset.Open(CRecordset::snapshot,strSql); if(dbset.IsBOF()) return false; while(!dbset.IsEOF()) { ... //read data if(!dbset.CanScroll()) break; dbset.MoveNext(); } }
After thousands of call, the program will crash at Open or MoveNext, thus see memory of the m_Property, m_Property.data is NULL and m_Property.m_dwDataLength is a very large num.
Check the assemble code from the source code, it corrupt in file dbrfx.cpp statement
case CFieldExchange::Fixup: // Get the size of the long binary field *plLength = pFX->GetLongBinarySize(nField);
Seems like when get the image data from the database, it's data was damage.
I know this is another Program is writing the db in the same time and will modify the record, is it the reason cause the crash, and would someone tell me the really reason? thanks
Please Help me! Emergency! Emil : xiazgli@163.com xzg
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
In Sybase, Field "Property" is a Image and it's size almost 16k CRecordset DoFieldExchange like: ... RFX_LongBinary(pFX, _T("[Property]"), m_Property); ...
I use it like: try { int ret = dbset.Open(CRecordset::snapshot,strSql); if(dbset.IsBOF()) return false; while(!dbset.IsEOF()) { ... //read data if(!dbset.CanScroll()) break; dbset.MoveNext(); } }
After thousands of call, the program will crash at Open or MoveNext, thus see memory of the m_Property, m_Property.data is NULL and m_Property.m_dwDataLength is a very large num.
I know this is another Program is writing the db in the same time and will modify the record, is it the reason cause the crash, and would someone tell me the really reason? thanks
xzg
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
dose the method work well when using it for a oracle database, can you give me the same example when i connet a oracle database thank you
inga_2000
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hello!
I have modified the code slightly so I can get this working for small .rtf files but not having much joy with Excel files (approx 20k big). I am running VC++ .NET 1.0 Framework.
The problem occurs on reading the file contents and writing them to a file. The small .rtf file would be created perfectly. However, with the Excel files, lpszbuffer in the below line comes out as a small garbled string and so falls over on CFile::Write...
lpszBuffer = (LPSTR) ::GlobalLock( lbData.m_hData );
Can anybody help?
Thanks,
Al
Alistair Findlay Software Developer http://www.thehob.co.uk
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I am have trouble getting the code to work when there is a record in the table. I get the error data truncated. Some research has shown that there is a KB article PSS ID Number: 141303 in MSDN at ms-help://MS.VSCC.2003/MS.MSDNQTR.2003APR.1033/enu_kbvisualc/visualc/141303.htm
http://support.microsoft.com/?kbid=141303
that describes the situation: a bug in MFC. However the solution does not work. It looks like the interface to CDatabase and CRecordset has changed since the workaround was created.
Does anyone have any idea what is going on wiht the issue?
Thanks...
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
the Bug is not exist after Visual c++ 4.2 , before you open you RecordSet ,if your Oracle Table has BLOB column ,you must set the Member m_bLongBinary=TRUE; then it will not throw the exception .
later upload
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
hello thanks for your code ,but i need help i use SQL server 2000 if my data is english language when i call update() it's ok but if my data is any language such as thai language when i call update() it change to ?????? who can resolve this problem 
::: if i call addnew() without image data it's ok
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
I using c++ to make CGI and want to create and store images from and to a database.
My code to do other communication yuo can see below, to retrieve a textfield is ok but I can not find out how to create a image see "???"
CString path="E:\\program files\\Cplusplus\\test\\"; CString searchstr="SELECT * FROM T_Attachments WHERE C_PrimaryKey='" + sKey + "'"; CoInitialize(NULL); _RecordsetPtr pRs = NULL; //-- This is the Recordset Variable _ConnectionPtr pCn = NULL; //-- This is the Connection Variable _bstr_t strCnn("DSN=SupportDSN; UID=xx; PWD=xx");
pCn.CreateInstance(__uuidof(Connection)); pCn->Open(strCnn,"xx","xx",adConnectUnspecified);
pRs.CreateInstance(__uuidof(Recordset)); pRs->Open((LPCTSTR)searchstr, _variant_t((IDispatch *)pCn,true), adOpenKeyset, adLockOptimistic, adCmdText);
path+=(char*) ((_bstr_t) pRs->GetFields()->GetItem("C_Name")->GetValue());
CFile outFile(path,CFile::modeCreate|CFile::modeWrite); buffer = ??? outFile.WriteHuge(buffer,sizeof(buffer)); outFile.Close();
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I am trying to allow the insert/retrieval of BLOBS to my ASA database. When there are no records in the database I am able to add one record. When I try to open the table with any data in the table I get an MFC out of memory error. Has anyone seen this, or have any insight to the problem.
Thanks
Stan
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
This may be 3 years late or so, but maybe it'll help someone:
I use Sybase ASA & I've seen this too... I think it has to do w/ the ODBC API call that tells MFC the size of the field after the SELECT statement is executed & before the SQLFetch()/SQLGetData call is made. I think it's SQLDescribeCol... for LONG VARCHAR & LONG BINARY fields, Sybase reports a really huge number, something like what -1 looks like when you view it as an unsigned long. That's not exactly the #, but that's why it gives the 'Out of Memory' exception when it tries to allocate enough memory for the column.
My fix for my LONG VARCHAR fields was to use a CString instead of a CLongBinary, then in CMyRecordset::DoFieldExchange, change the RFX_Text call like so:
RFX_Text(pFX, _T("[myBlob]"), m_strBlob, 4096 * 4, SQL_LONGVARCHAR);
It's not the best to pass a hard coded max buffer size, but it worked for me. I think you can change that to a variable or function result, but it probably only works if you aren't doing bulk fetching w/ your recordset. Still working on what to do w/ LONG BINARY tho....
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
ok for the creation (addnew) of a BLOB. It work perfectly and my database is just growing up as long as I test it. So how to delete a record. The classical Delete() function gives back error message (I do not previously set the Addnew() or Edit() function as it is requested for the Delete mode). The Update() function gives back the same error (with the Recordset previously set to Edit() mode ).
Thank you very much
Mate
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
You need to give a lot more detail to get help from anyone. There are a lot of error messages that you have left us to guess about.
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
ok for the creation (addnew) of a BLOB. It work perfectly and my database is just growing up as long as I test it. So how to delete a record. The classical Delete() function gives back error message (I do not previously set the Addnew() or Edit() function as it is requested for the Delete mode). The Update() function gives back the same error (with the Recordset previously set to Edit() mode ).
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
I've been using OCI library calls till recently to talk to ORACLE D/B and it works pretty fine. But when i try to use ODBC for the same, i am not sure as how the BLOB object needs to be updated to the D/B. I've tried it as mentioned in this article, but encounter the error MissingExpression: ora-00936. Also when we use OCI calls, we select the OCILobLocator for update, write into it and just commit. But in the ODBC version, when i used the edit/update, i observed that the ultimate SQL statement that is being framed is an "update". If anyone has done the BLOB updation to ORACLE using ODBC, please do let me know as how it needs to be done.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
It strongly depends on the ODBC-Driver Version you're using. i.e. using the latest driver 8.1.77 to read/write a long raw into a 8.1.7 Oracle database with this sample will work, also if you are using the Merant (ex-Intersolv) drivers. Using older Oracle drivers often leads into the problems you encountered.
|
| Sign In·View Thread·PermaLink | 2.00/5 (3 votes) |
|
|
|
 |