inserting content of text file to Access data field
-
Hi All, I am wondering if anybody know sql statement of how to import all the text from the text file into Access database field? I have a text file, a.txt and afield called TextBody in the table. TextBody is a memo size. I was inserting like following
aTextfile.open("c:\\a.txt",ios::in); if(aTextfile) { while(!aTextfile.eof()) { aTextfile.getline(data,1024,'\n'); temp.Format("%s",data); qstr.Format("UPDATE %s Set TextBody = TextBody & '%s' ",tablename,temp); rs.m_pDatabase->ExecuteSQL(qstr); } aTextfile.close(); }
But it takes so long to import all the text from the a.txt. Is there any better way? Thanks -
Hi All, I am wondering if anybody know sql statement of how to import all the text from the text file into Access database field? I have a text file, a.txt and afield called TextBody in the table. TextBody is a memo size. I was inserting like following
aTextfile.open("c:\\a.txt",ios::in); if(aTextfile) { while(!aTextfile.eof()) { aTextfile.getline(data,1024,'\n'); temp.Format("%s",data); qstr.Format("UPDATE %s Set TextBody = TextBody & '%s' ",tablename,temp); rs.m_pDatabase->ExecuteSQL(qstr); } aTextfile.close(); }
But it takes so long to import all the text from the a.txt. Is there any better way? Thanks