Hi
I have an mfc script that will read the source code of a html file on a webserver and insert each line of html in the database. The only problem with it is the contents of the database isnt html source code its a bunch of question marks. What am i doing wrong? The source code im using is below.
Thanks
CInternetSession session; //** define our internet session
//** define our internet file that will hold the source
CInternetFile* pFile = (CInternetFile *)session.OpenURL(L"http://webworthdesign.com/");
if(pFile) //** If we can OpenURL(m_strURL)
{
CString string; //** Create a buffer string
while (pFile->ReadString(string) != NULL) //** Read as many string as we can until we run into EOF(End Of File)
{
CDatabase db;
db.OpenEx(L"DRIVER=MySQL ODBC 3.51 Driver;UID=root;SERVER=192.168.0.30;PWD=pass;DB=mycppdb;PORT=0;OPTION=0;");
db.ExecuteSQL(L"INSERT INTO mytable(myfield) VALUES('"+string+L"')");
}
m_strSource.SetWindowText(L"Write done");
}