 |
|
|
 |
|
 |
dbImages.Open() is taking 100% CPU usage??
|
|
|
|
 |
|
 |
Hi,
I have to update a blob data into db but with tables that dynamically change. could you please help in this.
|
|
|
|
 |
|
 |
Hi, I am trying to save .txt file using CLongBinary class. I am using Interbase 6.0 database.Database connection is successfully made using following code: CString ServerConnectingString; ServerConnectingString.Format("DSN=ServerDatabase;UID=SYSDBA;PWD=masterkey"); try { pServerDatabase->OpenEx(ServerConnectingString,CDatabase::noOdbcDialog); } I have also read "1.txt" file & stored in CLongBinary pointer same as mentioned in sample code.But when i am trying to open recordset with following code: CRecordset rsSDetails(pApp->pServerDatabase); rsSDetails.Open(CRecordset::snapshot,_T("SELECT * FROM TEST")); Then following errors are displayed: CDBException e.m_strError = "Driver does not support this function" CDBException e.m_strStateNativeOrigin = {"State:IM001,Native ,Origin:[Microsoft][ODBC Driver Manager] "} Please help me out. I tried many times, but it is not working. Please reply me any workaround to fix it as soon as possible. Thanks
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
|
 |
|
 |
It is really good.
Thanks Shekar Narayanan.
|
|
|
|
 |
|
 |
how to insert images into oracle using BLOB?
|
|
|
|
 |
|
 |
How to add a record for descriping the picture?
|
|
|
|
 |
|
 |
how to insert image to SQL server?
thanks for your help.
An Phung Nguyen
|
|
|
|
 |
|
 |
how to insert images into oracle using BLOB?
|
|
|
|
 |
|
 |
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...
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
Hi
Does anyone know how to store and retireve data using the CByteArray
class?
Thanks
Mark
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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...
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
|
 |
|
 |
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();
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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....
|
|
|
|
 |
|
 |
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
|
|
|
|
 |