Click here to Skip to main content
15,897,891 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMenu dropdown event in SDI application Pin
rp_suman18-Dec-09 0:23
rp_suman18-Dec-09 0:23 
AnswerRe: Menu dropdown event in SDI application Pin
Code-o-mat18-Dec-09 1:03
Code-o-mat18-Dec-09 1:03 
QuestionMSSQL USE DATABASE Pin
MsmVc17-Dec-09 22:30
MsmVc17-Dec-09 22:30 
AnswerRe: MSSQL USE DATABASE Pin
Code-o-mat17-Dec-09 23:24
Code-o-mat17-Dec-09 23:24 
GeneralRe: MSSQL USE DATABASE Pin
MsmVc17-Dec-09 23:29
MsmVc17-Dec-09 23:29 
GeneralRe: MSSQL USE DATABASE Pin
Code-o-mat18-Dec-09 0:52
Code-o-mat18-Dec-09 0:52 
GeneralRe: MSSQL USE DATABASE Pin
David Crow18-Dec-09 2:56
David Crow18-Dec-09 2:56 
GeneralRe: MSSQL USE DATABASE Pin
MsmVc18-Dec-09 17:19
MsmVc18-Dec-09 17:19 
i connect MSSQL 2005 through this code successfuly.
CString str1="",str2="",str3="";
	HRESULT hr;
	if SUCCEEDED(hr = CoInitialize(NULL))
	{
		try
		{
		
			if (SUCCEEDED(spSQLServer.CreateInstance(__uuidof(SQLServer2))))
			{
				try
				{
					HOST=(_bstr_t)m_MHOST;
				
					if(rad1.GetCheck())
					{
						spSQLServer->LoginSecure = TRUE;
						spSQLServer->Connect((_bstr_t)m_MHOST);
					}
					else
					{
						spSQLServer->LoginSecure = FALSE;
						spSQLServer->Connect((_bstr_t)m_MHOST,(_bstr_t)m_MUSR,(_bstr_t)m_MPWD);
					}
					
				
					
				
				}
				catch(_com_error pCE)
				{
				
					str2.Format(_T("%s"),
					MessageBox(str2,"Message");
					return TRUE;
				}
			}
			else
			{
				str3.Format(_T("Unable to create the SQL Server object.\n"));
		
			}
		}
		catch(_com_error pCE)
		{
			str2.Format(_T("\n%s Error: %ld\r\n%s\r\n%s\r\n"),
				(TCHAR*)pCE.Source(),
				pCE.Error(),
				(TCHAR*)pCE.Description(),
				(TCHAR*)pCE.ErrorMessage());
		}

	
	}
	else
	{
		str2.Format(_T("Call to CoInitialize failed.\n"));
	}

Then i use this code for use database
QueryResultsPtr Qry;
_SQLServer2Ptr spSQLServer;
CString udata="use databasename";
Qry=spSQLServer->ExecuteWithResults((_bstr_t)udata,(LONG)udata.GetLength());

Questionfathers and mothers, how to convert hicon to png file? Pin
nenfa17-Dec-09 22:12
nenfa17-Dec-09 22:12 
AnswerRe: fathers and mothers, how to convert hicon to png file? Pin
Michael Schubert17-Dec-09 22:26
Michael Schubert17-Dec-09 22:26 
GeneralRe: fathers and mothers, how to convert hicon to png file? Pin
nenfa18-Dec-09 1:48
nenfa18-Dec-09 1:48 
AnswerRe: fathers and mothers, how to convert hicon to png file? Pin
KarstenK17-Dec-09 22:37
mveKarstenK17-Dec-09 22:37 
AnswerRe: fathers and mothers, how to convert hicon to png file? Pin
CPallini18-Dec-09 0:06
mveCPallini18-Dec-09 0:06 
GeneralRe: fathers and mothers, how to convert hicon to png file? Pin
nenfa18-Dec-09 15:39
nenfa18-Dec-09 15:39 
QuestionHow to get textual description of the SEH error code in __except handler? Pin
Chesnokov Yuriy17-Dec-09 21:49
professionalChesnokov Yuriy17-Dec-09 21:49 
AnswerRe: How to get textual description of the SEH error code in __except handler? Pin
Maxwell Chen17-Dec-09 21:58
Maxwell Chen17-Dec-09 21:58 
QuestionRe: How to get textual description of the SEH error code in __except handler? Pin
Chesnokov Yuriy17-Dec-09 22:08
professionalChesnokov Yuriy17-Dec-09 22:08 
AnswerRe: How to get textual description of the SEH error code in __except handler? Pin
KarstenK17-Dec-09 22:40
mveKarstenK17-Dec-09 22:40 
QuestionRe: How to get textual description of the SEH error code in __except handler? Pin
Chesnokov Yuriy17-Dec-09 23:00
professionalChesnokov Yuriy17-Dec-09 23:00 
AnswerRe: How to get textual description of the SEH error code in __except handler? Pin
KarstenK17-Dec-09 23:04
mveKarstenK17-Dec-09 23:04 
QuestionRe: How to get textual description of the SEH error code in __except handler? Pin
Chesnokov Yuriy18-Dec-09 0:14
professionalChesnokov Yuriy18-Dec-09 0:14 
AnswerRe: How to get textual description of the SEH error code in __except handler? Pin
KarstenK18-Dec-09 0:19
mveKarstenK18-Dec-09 0:19 
Questionfor loop Pin
sharanu17-Dec-09 21:23
sharanu17-Dec-09 21:23 
AnswerRe: for loop Pin
CPallini17-Dec-09 21:29
mveCPallini17-Dec-09 21:29 
GeneralRe: for loop Pin
sharanu17-Dec-09 21:37
sharanu17-Dec-09 21:37 

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.