Click here to Skip to main content
16,010,544 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to check the system whether the system have installed Acrobate Reader or not? Pin
Dan Neely13-Sep-05 7:11
Dan Neely13-Sep-05 7:11 
QuestionManagementClass,WMI ?????? Pin
Tcpip200511-Sep-05 18:15
Tcpip200511-Sep-05 18:15 
AnswerRe: ManagementClass,WMI ?????? Pin
Christian Graus11-Sep-05 18:47
protectorChristian Graus11-Sep-05 18:47 
QuestionkSet a Static always ontop. Pin
tranglt11-Sep-05 18:09
tranglt11-Sep-05 18:09 
AnswerRe: kSet a Static always ontop. Pin
Christian Graus11-Sep-05 18:46
protectorChristian Graus11-Sep-05 18:46 
Questionconnect to database with Visual C++ 6.0 Pin
PhuLove11-Sep-05 17:31
PhuLove11-Sep-05 17:31 
AnswerRe: connect to database with Visual C++ 6.0 Pin
prasad_som11-Sep-05 19:57
prasad_som11-Sep-05 19:57 
AnswerRe: connect to database with Visual C++ 6.0 Pin
PravinSingh11-Sep-05 21:26
PravinSingh11-Sep-05 21:26 
Just to give you an idea, I recently used the following code in one of my projects:

CDatabase m_db; //you can have this in the .h file<br />
<br />
//The code checks for Oracle 8 first, and if not found, it checks for Oracle 9<br />
try<br />
{<br />
	CString sConnect;<br />
	sConnect ="DRIVER={Oracle in Ora81RET}; DBQ= MYDATABASE.LOCAL; UID=scott; PWD=tiger; PFC=500";<br />
	m_DB.OpenEx(sConnect, CDatabase::noOdbcDialog);<br />
}<br />
catch(CDBException *x)<br />
{<br />
	try<br />
	{<br />
		CString sConnect;<br />
		sConnect ="DRIVER={Oracle in OraHome92}; DBQ= MYDATABASE.LOCAL; UID=scott; PWD=tiger; PFC=500";<br />
		m_DB.OpenEx(sConnect, CDatabase::noOdbcDialog);<br />
	}<br />
	catch(CDBException *x)<br />
	{<br />
		CString szTemp = "Database Connection not responding due to following reason(s):\n\n";<br />
		szTemp += x->m_strError;<br />
		AfxMessageBox(szTemp, MB_ICONERROR);<br />
		exit(1);<br />
	}<br />
}


Then, to query the database, you can code like this:

CRecordset cSet(&m_DB);<br />
CString szSomething;<br />
CString szSQL = "SELECT SOMETHING FROM SOMEWHERE" //your query<br />
cSet.Open(CRecordset::forwardOnly, szSQL, CRecordset::readOnly);<br />
while(!cSet.IsEOF())<br />
{<br />
	cSet.GetFieldValue((int)0, szSomething);<br />
	cSet.MoveNext();<br />
}<br />
cSet.Close();


Hope that helps Wink | ;)


It's better to know some of the questions than all of the answers.

Pravin.
QuestionFindFirstFileEx and _WIN32_WINNT Pin
Chintoo72311-Sep-05 17:19
Chintoo72311-Sep-05 17:19 
AnswerRe: FindFirstFileEx and _WIN32_WINNT Pin
David Crow12-Sep-05 4:11
David Crow12-Sep-05 4:11 
GeneralRe: FindFirstFileEx and _WIN32_WINNT Pin
Chintoo72312-Sep-05 4:38
Chintoo72312-Sep-05 4:38 
GeneralRe: FindFirstFileEx and _WIN32_WINNT Pin
David Crow12-Sep-05 4:50
David Crow12-Sep-05 4:50 
Question#pragma warning(disable: 4786) Pin
LiYS11-Sep-05 16:57
LiYS11-Sep-05 16:57 
AnswerRe: #pragma warning(disable: 4786) Pin
Christian Graus11-Sep-05 17:11
protectorChristian Graus11-Sep-05 17:11 
GeneralRe: #pragma warning(disable: 4786) Pin
LiYS11-Sep-05 17:45
LiYS11-Sep-05 17:45 
AnswerRe: #pragma warning(disable: 4786) Pin
PJ Arends11-Sep-05 19:34
professionalPJ Arends11-Sep-05 19:34 
QuestionVC++ 2005 Express Beta with Windows Platform SDK? Pin
Lord Kixdemp11-Sep-05 13:24
Lord Kixdemp11-Sep-05 13:24 
AnswerRe: VC++ 2005 Express Beta with Windows Platform SDK? Pin
Christian Graus11-Sep-05 14:13
protectorChristian Graus11-Sep-05 14:13 
GeneralRe: VC++ 2005 Express Beta with Windows Platform SDK? Pin
Lord Kixdemp11-Sep-05 14:25
Lord Kixdemp11-Sep-05 14:25 
GeneralRe: VC++ 2005 Express Beta with Windows Platform SDK? Pin
Christian Graus11-Sep-05 14:33
protectorChristian Graus11-Sep-05 14:33 
GeneralRe: VC++ 2005 Express Beta with Windows Platform SDK? Pin
Lord Kixdemp11-Sep-05 15:38
Lord Kixdemp11-Sep-05 15:38 
GeneralRe: VC++ 2005 Express Beta with Windows Platform SDK? Pin
Christian Graus11-Sep-05 15:39
protectorChristian Graus11-Sep-05 15:39 
GeneralRe: VC++ 2005 Express Beta with Windows Platform SDK? Pin
Lord Kixdemp11-Sep-05 15:54
Lord Kixdemp11-Sep-05 15:54 
GeneralRe: VC++ 2005 Express Beta with Windows Platform SDK? Pin
Christian Graus11-Sep-05 15:58
protectorChristian Graus11-Sep-05 15:58 
GeneralRe: VC++ 2005 Express Beta with Windows Platform SDK? Pin
Lord Kixdemp11-Sep-05 16:33
Lord Kixdemp11-Sep-05 16:33 

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.