Hi,
The database field format that I have used for ID Number is text. However when keying in the value for dlg.m_IDNumber, it contains numbers. Is this ok? Or do I have to switch to integer format in the specification for the database field format. However if I switch to integer, then it s not...
Hi all,
I am using ODBC for my program. I want to specify a filter for the records in my MS access database. When my code for performing teh filter is as follows:
m_ParticipantSet->m_strFilter = "PartName = '" +
dlg.m_PartName + "'"...
Sorry for being so confusing pete.......The dialog box is originally open. By clicking the "OK" button I actually start a timer. I record the start time as Timing1. The timer continues running all the while. Then a sort of tag is supposed to be read and it triggers another function in...
Hi Pete,
I have no intention of opening the dialog box. If I m not wrong, using DoModal() will open the dialog box on the screen right? I only wish to retrieve a value from the CTimeDlg dialog and not open the entire dialog. So is the code you have shown above still workable?
Hi,
I am not too sure if I am answering what u r asking Rick. So please correct me if I m wrong. The value that I want to retrieve is the value of the time when the "OK" button is clicked in the CTimeDlg dialog box. On "OK" the CTime Timing1 variable is assigned the current...
Hi Rick,
I am actually trying to retrieve a value Timing1 from a dialog box named CTimeDlg. The dialog is ok. It is just that I want to import this value to do calculation in a function in CMainFrame. However using the above code, I cannot get the desired value. In the CTimeDlg, the correct...
Dear all,
I m trying to retrieve a value Timing1 from a dialog box named CTimeDlg to my CMainFrame. The code that I use is as follows:
CTimeDlg Timedlg;
CTime STime = Timedlg.Timing1;
CTime Now = CTime::GetCurentTime();
CTimeSpan Interval = Now - STime;
CString Timing =...
Hi Pete,
Actually I have already used ODBC for most part of the program so it is not possible for me to switch to ADO now. I actually receive a CTime object value. Then switch to CString to store in my database since I make use of the AddString() function to add to an array I constructed.Then I...
Dear all,
I have declared a CTime object as CTime Timing. I believe this is timing in seconds. I later convert it to a CString object using Timing.format("%H:%M:%S") This gives the timing in terms of Hours : Minutes : Seconds
I then store it in a daatbase. I wish to extract this...
Hi all,
I am facing a problem for my program. Basically I intend to update my database each time an event occurs. However I want to eliminate redundant records as in if a particular identity is already in my record for today, it must not appear again. Ut is ok if it appears tomorrow since the...
Thanks....I guess that is the problem. However I need to keep the while loop coz I want the same data to be in every entry of my database. However, even after removin the MoveNext() command, I still encounter the same error message " attempt to update or delete failed." Compiling...
Hi all,
I encountered the following problem. Code looks ok but and no errors when I compile. But when I activate the function an error is generated saying that attempt to update or delete failed. The code is as follows:
Timing1 = CTime::GetCurrentTime();
if( m_pCapturedResults.IsOpen() ==...
Hi all,
I am facing a problem. How do u fill a combobox with data from my database? I am looking to fill all the participants name in a race into a combo box. Then when I select the participant's name, all his particulars will also be displayed. I am using dialog for this. So do I put the code...
Hi,
I think I am calling from within the dialog class so I do away with the GetDocument().My code now reads
BOOL ViewRecordsDlg::OnInitDialog()
{
// Fill the combo box with all of the names
pDoc->m_viewrecordSet.m_strSort = "Name";
if (!pDoc->m_viewrecordSet.Open())
return...
Hi,
I am a relatively new MFC programmer and I have the following problem. In adding a second recordset to my dialog box, I want to add a combo box to list the names of all that is contained in my database. I used the following code
m_pSet = &GetDocument()->m_viewrecordSet;
m_pSet->m_pDatabase...
Hi qednick,
I am juz assuming it is looping because when I run the exe file, the window opens. Then when I click the button to open the dialog testdlg, the whole window hangs and I have to alt+ctrl+delete to end the program.I have checked and found that the resource ID is valid. But I do not not...
Hi,
I am a new user in Visual C++ 6.0.Using MFC, I created a single document application. From the application I wish to click a button to open a dialog box. The following is the code I used:
void CTest1Doc::OnButton1()
{
TestDlg testdlg;
int result = testdlg.DoModal():
}
It seems that it...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.