|
I try to open the database ImageIndex (Connected with ODBC) by using:
try
{
CRecordSet::Open(NULL, _T("Select ImageName, Caption From ImageIndex"), NULL);
}
catch(CException *e)
{
WCHAR ErrorMsg[1024];
e->GetErrorMessage(ErrorMsg, 1024, 0);
::AfxMessageBox(CString(ErrorMsg), MB_OK, 0);
return;
}
and it always give me back the Erros Message with Nothing in it.
The SERVER is MS SQL SERVER 2005. I can run the SQL query "Select ImageName, Caption From ImageIndex" in the SQL SERVER Management Stuido Express and it did return me the correct results that I want.
Anyone knows why this is happening?
Thank you very much.
|
|
|
|
|
Whats return value of Open? 0 or 1
|
|
|
|
|
It won't go through this line to return me a value.
|
|
|
|
|
You may want to pass some actual parameters instead of those NULLs
Also, CRecordset::Open is not static so I don't know about caling it like this:
CRecordSet::Open(...
Just a typo?
Anyway, maybe try catching CDBException* for details on the exception from ODBC...
try
{
CRecordSet::Open(NULL, _T("Select ImageName, Caption From ImageIndex"), NULL);
}
catch(CDBException *e)
{
TRACE(_T("*******************************************\n"));
TRACE(_T("** Database Exception \n"));
TRACE(_T("** %s \n"), e->m_strError);
TRACE(_T("** %s \n"), e->m_strStateNativeOrigin);
if (pszSrcCodeOrigin && _tcslen(pszSrcCodeOrigin) > 0)
{
TRACE(_T("** %s \n"), pszSrcCodeOrigin);
}
TRACE(_T("*******************************************\n"));
e->Delete();
}
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hello,
can i show the text underlinded in CListCtrl when the mouse is over a specified cell?
I know how to determine what cell is under the mousecursor,
but how to set font property to underlined?
Any idea how to do this?
thanks in advance
termal
|
|
|
|
|
|
Hello All,
I need to add a short cut icon to launch my custom application from
Start-->All Programs.
To elaborate, when I click on Start-->All Program,
I should be able to see the name of my applcation like many others already are (Microsoft Office etc.), clicking on icon should make me launch my application.I do not have any idea how to achieve this?
Please suggest.
Thanks and Regards.
Amarjeet.
|
|
|
|
|
|
Programmatically?
If yes...
SHGetSpecialFolderLocation() and SHGetPathFromIDList() can get you info on where to put shortcuts.
To create shortcuts, see Shell Links[^]
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi
i have got an VC++ application and when i try to open its solution file i get this message.
"The project 'abc.dsp' must be converted to the current Viusal C++ project format. After it has converted, you will not be able to edit this project in previous version of Visual Studio."
So that means it ws compiled in older version of VC++. Now if i convert it, i am able to compile the program but i am unable to step through the application.
To view the problem in detail pls visit my last post.
http://www.codeproject.com/script/comments/forums.asp?msg=2028885&forumid=1647&mode=all&userid=3708087#xx2028885xx
Thanks a lot
SS
|
|
|
|
|
in C, C++ we can execute DOS commands with system() at the time console window is appearing, i want to eliminate the console window while running the other programs
plz help me out
thanks in advance
vasu
|
|
|
|
|
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Try using system, _wsystem .
Regards,
Paresh.
|
|
|
|
|
Thnaks for ur reply
I'm already tried by using system() command, but it's showing the console window till the other programm executing, i want to close the console window once the other progrm start the execution.
vasu
|
|
|
|
|
what dos command you want to fire! actually all dos command has been encapsulated in win32 apis!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
hi all
this is the code to fetch data from mysql using vc++
but my problem is that data is not shown in info which i declare as cstring as
mysql return data in string
evrything is ok
but data is not shown in info variable please help me
GetDlgItemText(IDC_EDIT1,f);
info = select ID from login where name = \'" + f + "\'";
if ( ! mysql_query( myDB, info) )
{
res = mysql_store_result( myDB );
row = mysql_fetch_row( res );
}
thanks
hi
|
|
|
|
|
paras_s12 wrote: if ( ! mysql_query( myDB, info) )
Does info have the correct value prior to the call to mysql_query() ?
BTW, it's only been 92 minutes since you last asked this question. There's no need to post it again.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
ask same you on mysql forum you will get faster reply!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I would like to be able to access the mainframe menu from a non-modal dialog box - in other words, if I press Alt+F, the main File menu should get activated... any idea how to achieve that?
Thanks in advance!
|
|
|
|
|
One way is to send key events to your main window from modeless dialog box. SendMessage() with WM_KEYDOWN and WM_KEYUP in proper sequence might solve your problem.
|
|
|
|
|
Thanks .. but that's a bit of a hack if you do not mind me saying so
I would not want to have to implement all the accelerators like this.
|
|
|
|
|
Try AfxGetMainWnd()->SetFocus() .
Or, send a user-defined message to the CMainFrm object that includes code to drop set focus to itself and then drop the menu. (this is the mehtod I would probably use)
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Do you mean I should call AfxGetMainWnd()->SetFocus() whenever the Alt key is pressed?
|
|
|
|
|
why not if that solves your problem.
Also, to my answer I can add - you don't need to implement all your accelerators but can simply do SendMessage on OnKeyDown with if Alt is down.
|
|
|
|
|
Noooo... I mean do it when you handle Alt-F in your dialog.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|