|
thanks for reply
i know this message board is for C/C++/MFC related questions.My question is also C/C++/MFC related questions because
USE DATABASENAME syntax working fine in MSSQL.When i use this sysntax in MFC/C++ then it's not working.So here i ask this question.
No problem if you think then i have to move from here to there.
Thanks
|
|
|
|
|
I see, in this case, you should probably give some more details of how you tried to achieve your goal and what kind of problem/error did you get. Show some more code, maybe someone will know what is wrong.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
MsmVc wrote: My question is also C/C++/MFC related...
But you've shown no relevant code.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
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());
|
|
|
|
|
fathers and mothers, how to convert hicon to png file?
|
|
|
|
|
nenfa wrote: fathers and mothers
Fathers and Mothers are all on a break now, try Nieces and Nephews.
|
|
|
|
|
they are playing now, how about you?
|
|
|
|
|
|
Dear son, you may use GDI+ .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thanks, it's really a good programing tool
|
|
|
|
|
I've got console application.
__try {
}
__except() {
DWORD dwCode = GetExceptionCode();
}
Чесноков
|
|
|
|
|
Make one of your own.
Code table here[^]
std::string MakeExceptionMessage(DWORD code)
{
std::string sTxt;
switch(code)
{
case EXCEPTION_ACCESS_VIOLATION:
sTxt = "The thread attempts to read from or write to a virtual address for which it does not have access.";
break;
}
return sTxt;
}
Maxwell Chen
|
|
|
|
|
Is there system functions like FormatMessage?
I've got e.g. 0xC06D007E SEH which is failed to load Dll module I do not know if that code is available in defines?
VS provides such formatting for every SEH in debug output window, I wonder it uses system function call to format message?
Чесноков
|
|
|
|
|
read my signature
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
|
|
But I posted in the question it returns ERROR_MUI_FILE_NOT_FOUND in my case for any SEH code.
Does it need something added to my console application?
Чесноков
|
|
|
|
|
|
Hi ..
In one of my interview question.i was asked a question to print.If the input given is 5..The output must be..
*
* *
* * *
* * * *
* * * * *
I wrote a function as..
for(i=0;i<5;i++)
{
for(j=o;j<=i;j++)
printf("%d",j);
}
printf(" ");
The output is coming as
*
**
***
****
*****
I wanted as above..can anyone help me
Hi,,
I am sharan.
I have Completed my B.E(COmputers)in 2009.
thanking you
sharan
|
|
|
|
|
sharanu wrote: I wrote a function as..
for(i=0;i<5;i++)
{
for(j=o;j<=i;j++)
printf("%d",j);
}
printf(" ");
The output is coming as
*
**
***
****
*****
You're wrong: the output of your function (with 'o' bug fixed) is:
00101201230123401234
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thanks for ur reply sir..i am sorry..
plzreplace the printf("%d",j); as printf("*");
i think i am correct now
Hi,,
I am sharan.Working as a software Engineer in Indo-Fuji Software Company located in BTM Layout.Bangalore.India.
I have Completed my B.E(COmputers)in 2006.ANd I am having 2 years of Exp in VC++.
thanking you
sharan
|
|
|
|
|
Please don't take it bad, but... with that signature and asking such a question?
Shame that I can't vote from work.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Nelek wrote: Please don't take it bad, but... with that signature and asking such a question?
Ditto.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
This can be written as the below.
for(int i = 0; i < 5; i++) { for(int j = 0; j <= i; j++) printf("* "); printf("\n"); }
Maxwell Chen
|
|
|
|
|
look at the right code
for(int i=0;i<5;i++)
{
for(int j=0;j<5;j++)
{
if(j>i)
printf(" ");
else
printf("*");
}
printf("\n");
}
|
|
|
|