Click here to Skip to main content
15,892,643 members
Home / Discussions / Database
   

Database

 
AnswerRe: Need help in query Pin
Wayne Gaylard12-May-10 4:08
professionalWayne Gaylard12-May-10 4:08 
GeneralRe: Need help in query Pin
J4amieC12-May-10 5:23
J4amieC12-May-10 5:23 
QuestionHow can check the result of the TCP/IP connection???, Pin
Tunisien8611-May-10 23:37
Tunisien8611-May-10 23:37 
AnswerRe: How can check the result of the TCP/IP connection???, Pin
Simon_Whale12-May-10 0:14
Simon_Whale12-May-10 0:14 
GeneralRe: How can check the result of the TCP/IP connection???, Pin
Tunisien8612-May-10 1:02
Tunisien8612-May-10 1:02 
GeneralRe: How can check the result of the TCP/IP connection???, Pin
Simon_Whale12-May-10 1:07
Simon_Whale12-May-10 1:07 
AnswerRe: How can check the result of the TCP/IP connection???, Pin
CitrusTech12-May-10 20:12
CitrusTech12-May-10 20:12 
QuestionProblem to store file of size > 64 KB using BLOB in Interbase database Pin
navneet.professional11-May-10 21:14
navneet.professional11-May-10 21:14 
Hi,

I am successfully stored & retrieved image files of size less than 64 KB.But when I am storing a image file of size 3 MB, then there is no error,but it only stores partial data in database.
Please refer the code:
------------------------------------------------------------------
1. File CMyDb.hpp----->

class CMyDb : public CDatabase
{
public:
CMyDb();
virtual ~CMyDb();
virtual void BindParameters( HSTMT hstmt );

BYTE* m_pabImage; // address of the data of the blob
int m_nImageLen; // sizeof the data in the image, in bytes
CString m_sStmt; // looks like "UPDATE MyTable SET myFld=?
WHERE idxFld=123"
};
------------------------------------------------------------------
2. File CMyDb.cpp----->

CMyDb::CMyDb()
{
m_pabImage = NULL;
m_nImageLen = 0;
}

CMyDb::~CMyDb()
{

}
void CMyDb::BindParameters( HSTMT hstmt)
{
SQLINTEGER nLenOrInd= m_nImageLen;
SQLRETURN rc;
if ( m_sStmt.Find("?") == -1 )
{ // no binding needed
return;
}
rc= SQLBindParameter(
hstmt, (SQLSMALLINT)1, SQL_PARAM_INPUT, SQL_C_BINARY,
SQL_LONGVARCHAR,
m_nImageLen, 0, (void*)m_pabImage, m_nImageLen, &nLenOrInd);
}
------------------------------------------------------------------
3. File Main.cpp->

CFile file (sFileName, CFile::modeRead);//|CFile::typeBinary);
CFileStatus fileStatus;
file.GetStatus(fileStatus);
int nCntImgBytes= 3 * 1024 * 1024;//3MB buffer
BYTE* pabData = (BYTE*)calloc(nCntImgBytes,sizeof(BYTE));
DWORD lTemp = file.ReadHuge((void*)pabData,fileStatus.m_size);
pApp->pServerDatabase->m_pabImage = pabData;
pApp->pServerDatabase->m_nImageLen = fileStatus.m_size;
pApp->pServerDatabase->m_sStmt= "INSERT INTO TEST1 (\"NAME\" , \"myBlobfield\") VALUES ('2',?)";
pApp->pServerDatabase->ExecuteSQL( pApp->pServerDatabase->m_sStmt );
------------------------------------------------------------------

Please reply me as soon as possible.

Regards
Navneet
AnswerRe: Problem to store file of size > 64 KB using BLOB in Interbase database Pin
Bernhard Hiller12-May-10 2:35
Bernhard Hiller12-May-10 2:35 
AnswerRe: Problem to store file of size > 64 KB using BLOB in Interbase database Pin
Simon_Whale12-May-10 2:44
Simon_Whale12-May-10 2:44 
GeneralRe: Problem to store file of size > 64 KB using BLOB in Interbase database Pin
navneet.professional12-May-10 18:01
navneet.professional12-May-10 18:01 
AnswerRe: Problem to store file of size > 64 KB using BLOB in Interbase database Pin
Luc Pattyn12-May-10 4:24
sitebuilderLuc Pattyn12-May-10 4:24 
Questiona query !!! please help me fast fast fast Pin
reza assar11-May-10 1:45
reza assar11-May-10 1:45 
AnswerRe: a query !!! please help me fast fast fast Pin
J4amieC11-May-10 2:06
J4amieC11-May-10 2:06 
AnswerRe: a query !!! please help me fast fast fast Pin
The Man from U.N.C.L.E.11-May-10 7:10
The Man from U.N.C.L.E.11-May-10 7:10 
QuestionSearch + Sql server 2005 Pin
abcurl11-May-10 1:25
abcurl11-May-10 1:25 
AnswerRe: Search + Sql server 2005 Pin
Peace ON11-May-10 2:08
Peace ON11-May-10 2:08 
AnswerRe: Search + Sql server 2005 Pin
RyanEK11-May-10 15:47
RyanEK11-May-10 15:47 
GeneralRe: Search + Sql server 2005 Pin
abcurl11-May-10 19:01
abcurl11-May-10 19:01 
GeneralRe: Search + Sql server 2005 Pin
RyanEK11-May-10 19:48
RyanEK11-May-10 19:48 
GeneralRe: Search + Sql server 2005 Pin
abcurl12-May-10 0:28
abcurl12-May-10 0:28 
GeneralRe: Search + Sql server 2005 Pin
RyanEK12-May-10 14:38
RyanEK12-May-10 14:38 
QuestionCDOSYS problem Pin
cdpace11-May-10 0:53
cdpace11-May-10 0:53 
AnswerRe: CDOSYS problem Pin
Michael J. Eber13-May-10 10:41
Michael J. Eber13-May-10 10:41 
QuestionVersion Calculator Pin
bgates197010-May-10 11:07
bgates197010-May-10 11:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.