|
Hello lisoft ! Thank for your help.
here is my full code:
CDatabase database;
CString SqlString;
CString sSymbolName;
CString sDriver = "MICROSOFT ACCESS DRIVER (*.mdb)";
CString sDsn;
CString sFile = m_mdbPath;
int iRec = 0;
// Build ODBC connection string
sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=%s",sDriver,sFile);
TRY
{
database.Open(NULL,false,false,sDsn);
CRecordset recset( &database );
// Build the SQL statement
SqlString = "SELECT Name "
"FROM I/O device";
recset.Open(CRecordset::forwardOnly,SqlString,CRecordset::readOnly);
This code is totally working while accessing a table that have a name without space (for exeample "Symbols" but as soon as I used a table named "I/O device" then I got an error.
Do you have any idea?
Chan
The crazy guy
|
|
|
|
|
You can try to use a square brackets surround your table name just like:
"SELECT Name FROM [I/O device]"
Wish it will help you.
Lisoft
|
|
|
|
|
THANK YOU Lisoft
!
It works fine...I tried everything except these stu... []..
Thank you now my reading is perfect.
Chan
The crazy guy
|
|
|
|
|
Hey guys,
I don't know how to handle the events in Visual C++ . NET There seem to be no Class Wizard as it used to be in VS6
My problem is I need to handle certain events from certain classes. Primarily I need to execute a portion of code (function) when the CSocket class (or CAsynSocket class) detects an event OnConnect(), notifying my MFC application about a client trying to connect to this server. The class CAsynSocket has this function (onConnect), I just don't know how to use it.
Even something simpler like executing a function when the key is pressed or the mouse is moved. Even that would help. Any event handling sugesstions would be greatelly appreciated.
Thanks.
Best regards,
Andrew
|
|
|
|
|
Hi Andrew,
I do this by using the Properties Window (under the View menu). Choose the .h or .cpp file of a class then open the Properties Window, there are 3 buttons which allow you to see Events, Messages and Overrides for that class.
Hope that helps,
Rob
|
|
|
|
|
Thanks a lot. It helped me to get started. Now I can handle any messages of the classes that are included in my project. Now I need to find out how to handle a message that is not included in my project (just some class from the library) in my case it is CSockets. I should be able to get it. Thanks again.
Best regards,
Andrew
|
|
|
|
|
How can I make certain data items in my CComboBox control appear/react as if they were inactive (not selectable, but visibly "ghosted"?)
Thanks,
Johnny
|
|
|
|
|
With a standard ComboBox, you can't.
But if you look in the combo box section of this site, there are several articles
about implementing special behaviour. The control I use is called (imaginatively)
CDisabledItemComboBox<code>, written by Petr Novotny.<br />
<br />
Iain.
|
|
|
|
|
Hi,
I have a problem to use fmode function in visual C++
If i use :
fmode(-2,10)
i obtain 0.
But in using Microsoft Excel MODE function like this :
MODE(-2;10)
i obtain 8
Where is the problem.
Thanks in advance
|
|
|
|
|
Dear all,
I have a dialog and some common controls (buttons, statics...) on that. To resize my controls when my dialog is being resized, I used MoveWindow and SetWindowPos functions. However, this caused lots of annoying flicker. How do I prevent this problem?
Thanks.
|
|
|
|
|
Control Panel->Display->Effects->Show window contents while dragging. Uncheck this checkbox.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks for your quick reply. However, I still want that option checked and moving/resizing controls without any flicker.
|
|
|
|
|
Look up
BeginDeferWindowPos
DeferWindowPos
EndDeferWindowPos
and try using those functions instead.
Iain.
|
|
|
|
|
Hey all, I am looking for a way to detect if certain applications are running. For instance, if I have an application running that is XXX.exe, how can I detect if the process is running? I am trying to write a small app where the user can select the filename exe and I will go looking to see if that application is running. I am not sure what to use, I have looked through the articles but I couldn't find anything that matches, but it could have been the search criteria I am using as well. This is for VC 6.0, no C# or .NET is involved. Any ideas???
|
|
|
|
|
See the EnumProcesses function.
|
|
|
|
|
Use these Apis
CreateToolhelp32Snapshot : to get handle of all running process
then using
Process32First and Process32Next enumerate all the process.
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
i am developing a dialoge based application and i want to use while loop in it but it does not work the way it works in simple console application, can any one help me in this,
|
|
|
|
|
syaks wrote:
it does not work the way
You might elaborate on what you mean by it is not working. Give some details on what the code should do and what it is doing, and paste a few lines of your code in the forum. It will give a better idea of what the problem might be.
|
|
|
|
|
window is event-base, that means that when the application catch a message, the "main function" (winmain) calls the function associated to this event. if you write a while loop in one of these functions, you take the risk that if your loop is infinite, your program look dead (in fact, blocked in the loop)... you so must be careful on such loops in windows programming.
why do you want a while ?
can't you use a timer instead ?
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
Huh ?
what exacly are you trying to do ?
while loops work the same way in dialog based applications or console applications; loops will always "stop" the normal flow of the application; meaning that if you want to use a while loop in your dialog, and you see that the UI does not respond, well, that's the way it is; if you need the UI to respond to user input while doing a loop, have a look at some of the articles here on CP ( I don't have a direct link ).
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
When using scrollview how often does the scroll refresh the screen?
Right now my text print out would overlap if I scroll too fast. As soon I resize the print out would be correct, which leads me to believe scroll is skipping drawing update.
I wrote a little debug to see what my scroll position but most of the time it wouldn't print out until I resize the window.
|
|
|
|
|
My debug info should disappear when I scroll but it stays around when I scroll up and down(until "next scroll update" or resize update)
|
|
|
|
|
How can I change the postion of the "Message Box" window.
|
|
|
|
|
CWnd::SetWindowPos()
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
Hey every one.
we know that we can change any project and give it xp look, but I am wondering if there any way to give it MACINTOSH look...
I read in the site -=> http://www.codeproject.com/w2k/xptheme.asp[^]
by using xml codes... so any way to do it but with MAC theme?
thanks in advance
|
|
|
|