GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 09-Nov-2007, 12:43
daveofwar daveofwar is offline
New Member
 
Join Date: Nov 2007
Posts: 1
daveofwar is on a distinguished road

Getting HTML source returns garbage/unexpected data


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


CPP / C++ / C Code:
	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");		
	}
 
 

Recent GIDBlogMeeting the local Iraqis by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] Doubly-linked List dsmith C Programming Language 6 14-Apr-2006 13:12
C++ Linear Regression with Outliers bartb C++ Forum 1 06-Mar-2005 08:27
Having a problem Chuckles Computer Hardware Forum 19 13-Sep-2004 12:17
[CONTEST?]Data Structure Test dsmith C Programming Language 2 06-Jun-2004 15:13
web server in secure mode not connecting to http application tcsasp Apache Web Server Forum 0 06-Nov-2003 00:08

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:52.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.