|
I'm trying to get my program to acess a database(.mdb) and change the part of the field it's in.
(ie getting the field2 info for Car4). I have tried many things and I just can't seem to figure it out. Thank you for your help.
____________
|Field1|Field2|
|Car1 |Ratio1|
|Car2 |Ratio2|
|Car3 |Ratio3|
|Car4 |Ratio4|
|Car5 |Ratio5|
|
|
|
|
|
Should be something like:
Update Field2 where Field1 = Car4
Not sure about the syntax for that database.
Not sure if I was any help.
Good Luck,
Jerry
|
|
|
|
|
Have you tried using ClassWizard to derive a class from CRecordset ? It will ask you for a data source name (which is tied to your Access file). That class will then contain a member variable for each column (i.e., field) in the database. For querying the rows, the default SQL statement will effectively be SELECT * FROM . To update a row, you'll set the m_strFilter member, then call the Requery() method. At that point, the record pointer is on the row you want to change. Call Edit() , assign each of the record set's member variables their new value, and call Update() .
This is not an exact recipe, but it will get you going. Using the keywords I've shown here, search here at CP, or MSDN, for a bunch of examples.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I don't want to change the fields just get the info thats in them. So in my code if I put something like
SELECT* FROM gear
m_strFilter.Requery(variable);
right or that wouldn't work? Thank you for your help.
|
|
|
|
|
MrNiceBerG wrote:
SELECT* FROM gear
Put this as the return value from GetDefaultSQL() .
MrNiceBerG wrote:
m_strFilter.Requery(variable);
right or that wouldn't work?
No, because Requery() accepts no parameters.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hello:
When using Date Time Picker, it defaults to Dec 31, 1969. If I select a date before that, once I do a UpdateData(TRUE), I get an error Debug Assert Error - timecore.cpp line 40. ----> ASSERT(m_time != -1);
How can I limit the dates that can be selected? How can I make it default to today's date?
Thank you
CTime::CTime(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec,
int nDST)
{
struct tm atm;
atm.tm_sec = nSec;
atm.tm_min = nMin;
atm.tm_hour = nHour;
ASSERT(nDay >= 1 && nDay <= 31);
atm.tm_mday = nDay;
ASSERT(nMonth >= 1 && nMonth <= 12);
atm.tm_mon = nMonth - 1; // tm_mon is 0 based
ASSERT(nYear >= 1900);
atm.tm_year = nYear - 1900; // tm_year is 1900 based
atm.tm_isdst = nDST;
m_time = mktime(&atm);
----> ASSERT(m_time != -1); // indicates an illegal input time
}
|
|
|
|
|
I think CDateTimeCtrl::SetRange() is what you are after.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi
It is somebody who had some problem before with this type of exception ?
EXCEPTION_IN_PAGE_ERROR
Thanks,
Florian Szoke
|
|
|
|
|
From MSDN:
The thread tried to access a page that was not present, and the system was unable to load the page. For example, this exception might occur if a network connection is lost while running a program over the network.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thank You ... but this desciption doesn't help too much... at least for me.
I am intrested for some details if somebody run over this .
|
|
|
|
|
nope cant say I have, I did a quick check in MSDN documentation and didnt find it. What kind of control sent the error? that would help determine where and why it was thrown.
|
|
|
|
|
I have an ActiveX into a VB form and after a while ( 3 or more hours ) on the right click when I want to load the menu from the resourse( ex: obj.LoadMenu(ID)) I am getting this exception. And from that moment it is happen every time you do a right click. If you will restard the app everything it is fine until it is starting again.
|
|
|
|
|
Have you tried this forum?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
Just checking. When I saw "VB" in your post, I just wanted to make sure you knew this was the VC++ forum.
Anyway, the problem needs to be narrowed down a bit before it can be effectively diagnosed. Debugging a whole application with the minimal information you've provided is akin to finding a needle in a haystack.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I am sorry but I dont need to debug my app, I was asking people who enconter that problem if they can share information
|
|
|
|
|
You are receiving an exception error in your application but you are not interested in debugging it.
What information are you wanting others to share (that does not directly lead to a bug being fixed)?
There are many reasons, including the one I provided, why that exception could be thrown. Regardless of why it gets thrown, don't you think it's something you might want to address?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Florian Szoke wrote:
sorry but I dont need to debug my app
sorry you need to do the dirty work of your own app.
Florian Szoke wrote:
I was asking people who enconter that problem if they can share information
Its a rare Case you will be extreamly lucky if you find one.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
yes , it is rare... and I did't find anything on the internet just that small definition from MSDN
|
|
|
|
|
I was typeing to fast and I mist a word "you".
I am sorry but I dont need you to debug my app, I was asking people who enconter that problem if they can share information
|
|
|
|
|
Florian Szoke wrote:
I was typeing to fast and I mist a word "you".
If you slow down little bit more you won't miss the missing letters too.;)
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
I am having a problem with a control "keeping" focused.
I have a tree control. When I double click on it, and hit a node, I want to set focus to another control (an edit control), so that I can start typing and have the key strokes go to the edit control.
Just like VC does when you double click on a node in the workspace tree and it takes you to a text editor.
Except that of course this doesn't seem to work.
So I made a simple test case - ran the MFC wizard and created an explorer style app.
Add a OnLButtonDblClk handle to the tree control and in it added code to get the right pane control, and set focus to it.
Sure enough, same behaviour - the right pane temporarily gets the focus but DOES NOT RETAIN IT !!!!!
Is there some magical procedure I have to follow?
Do I need to sacrifice virgins? Goats? Call up the Evil One?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Jim Crafton wrote:
Is there some magical procedure I have to follow?
no there is no magical solution in programming.
Jim Crafton wrote:
Do I need to sacrifice virgins?
errr, if you could send one to me.
Any ways back to the problem,
I believe the best place to set the focus onto another window is in TVN_ITEMEXPANDED notification.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
Hmm, ok, I'll try that, but what about the general principal - is the act of "dbl clicking" some how sending a second focus message back to the control you dbl clicked on so that it stays focused? Plus what do you do if the iten has no children? Then it will NOT recv a TVN_ITEMEXPANDED will it, as there is nothing to expand!?
Curiously, I even try *posting* a WM_SETFOCUS message to the edit control, which had the weird effect of activating the edit's caret, so it was flashing on and off, but the focus was still with the tree control! And keyboard input still went to the tree control!
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Muwahhhhhaaaahaahaa!
Eureka!
The key is to NOT allow the Default WndProc to get called!
So in MFC land:
void CLeftView::OnLButtonDblClk(UINT nFlags, CPoint point)
{
CMainFrame* frm = (CMainFrame*)AfxGetApp()->GetMainWnd();
CFocusTestView* view = frm->GetRightPane();
view->SetFocus();
}
Note: I commented out the call to the super classes handler. If I put this back, I get the weird behaviour again. Bizarre, but it works. I wonder what weird hidden things this breaks?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|