المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : mysql_fetch_field



C++ Programming
12-04-2009, 09:41 AM
Hello All
I getting exception while I use mysql_fetch_field.I use debug then I found when table rows is more than 229000 then Iam getting exception in this line field1=mysql_fetch_field(res1);.
Unhandled exception at 0x10010d74 in SQLconvert.exe: 0xC0000005: Access violation reading ******** 0x00000040.
Call stack shows

libmySQL.dll!10010d74()
[Frames below may be incorrect and/or missing, no symbols loaded for libmySQL.dll]
> SQLconvert.exe!CSQLconvertDlg::EnumRow(ATL::CStringT tab="sheet1") Line 1400 + 0xc bytes C++
SQLconvert.exe!CSQLconvertDlg::Convert() Line 1147 C++
SQLconvert.exe!readThread(void * p=0x0012f254) Line 56 C++
SQLconvert.exe!_AfxThreadEntry(void * pParam=0x0012e5c0) Line 109 + 0xf bytes C++
SQLconvert.exe!_callthreadstartex() Line 348 + 0xf bytes C
SQLconvert.exe!_threadstartex(void * ptd=0x003fd628) Line 331 C
kernel32.dll!7c80b699()

code is here

QueryResultsPtr Qry;
MYSQL_FIELD *field1;
MYSQL_RES *res;
enum enum_field_types type;
if (!mysql_query(conn,” SELECT * FROM tes”))
{
res = mysql_store_result(conn) ;
int numrows = (int)mysql_num_rows(res);
int numflds = (int)mysql_num_fields(res);

while (row = mysql_fetch_row(res))
{

res1=mysql_list_fields(conn,tab,"%");
for(long y=0; yflags & AUTO_INCREMENT_FLAG)
continue;
str2+=(LPTSTR)row[y];
type=field1->type;

}
}
}