Connect database when start with window
-
I use ADO to connect to database. I connect successfully. But when I run my application with window there's an error : Debug error : This application has requested the Runtime to terminate it in an unusual way Some one plz explain for me & give me a solution :rose:
-
I use ADO to connect to database. I connect successfully. But when I run my application with window there's an error : Debug error : This application has requested the Runtime to terminate it in an unusual way Some one plz explain for me & give me a solution :rose:
capint wrote:
This application has requested the Runtime to terminate it in an unusual way Some one plz explain for me & give me a solution [Rose]
Please read the guidelines[^] and rephrase your question in accordance to it. With the information you've provided, I can only tell that there's "something wrong" with your code. That may not be a very helpful reply though.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
capint wrote:
This application has requested the Runtime to terminate it in an unusual way Some one plz explain for me & give me a solution [Rose]
Please read the guidelines[^] and rephrase your question in accordance to it. With the information you've provided, I can only tell that there's "something wrong" with your code. That may not be a very helpful reply though.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
I mean that I connected successfully & I used it properly when I directly click on the application file. It just doesn't do well when start with window. Here is a part of my code. Plz help me :confused:
iSize = 0;
DateTimeNote Temp;
bool bFlag = true;
Open("Provider=Microsoft.Jet.OLEDB.4.0; \
Data Source=DateNote.mdb");
CString sql;
variant_t vNull;
variant_t TheValue;vNull.vt = VT\_ERROR; vNull.scode = DISP\_E\_PARAMNOTFOUND;
CString StrResult;
CString StrSql;
CString StrDateTime;
CString StrDateTimeTemp;StrDateTime.Format(_T("%i/%i/%i"),DateTime.GetMonth(),DateTime.GetDay(),DateTime.GetYear());
StrSql.Format(_T("SELECT * FROM DATETIMENOTE WHERE NGAY = '%s'"), StrDateTime);m_pRecordset.CreateInstance(__uuidof(Recordset));
m_pRecordset->PutRefActiveConnection(m_pConnection);
m_pRecordset->Open(_variant_t(StrSql), vNull, adOpenForwardOnly, adLockOptimistic, adCmdText);while (!m_pRecordset->GetEndOfFile())
{
TheValue = m_pRecordset->GetCollect("GIO");
if(TheValue.vt != VT_NULL)
{
StrResult = (char *)_bstr_t(TheValue);
StrDateTimeTemp = StrDateTime + _T(" ") + StrResult;
Temp.DateTime.ParseDateTime(StrDateTimeTemp, LOCALE_NOUSEROVERRIDE, LANG_USER_DEFAULT);
}
TheValue = m_pRecordset->GetCollect("NOTE");
if(TheValue.vt != VT_NULL)
{
StrResult = (char *)_bstr_t(TheValue);
Temp.Note = StrResult;
}
pTemp[iSize] = Temp;
iSize ++;
m_pRecordset->MoveNext();
} -
I mean that I connected successfully & I used it properly when I directly click on the application file. It just doesn't do well when start with window. Here is a part of my code. Plz help me :confused:
iSize = 0;
DateTimeNote Temp;
bool bFlag = true;
Open("Provider=Microsoft.Jet.OLEDB.4.0; \
Data Source=DateNote.mdb");
CString sql;
variant_t vNull;
variant_t TheValue;vNull.vt = VT\_ERROR; vNull.scode = DISP\_E\_PARAMNOTFOUND;
CString StrResult;
CString StrSql;
CString StrDateTime;
CString StrDateTimeTemp;StrDateTime.Format(_T("%i/%i/%i"),DateTime.GetMonth(),DateTime.GetDay(),DateTime.GetYear());
StrSql.Format(_T("SELECT * FROM DATETIMENOTE WHERE NGAY = '%s'"), StrDateTime);m_pRecordset.CreateInstance(__uuidof(Recordset));
m_pRecordset->PutRefActiveConnection(m_pConnection);
m_pRecordset->Open(_variant_t(StrSql), vNull, adOpenForwardOnly, adLockOptimistic, adCmdText);while (!m_pRecordset->GetEndOfFile())
{
TheValue = m_pRecordset->GetCollect("GIO");
if(TheValue.vt != VT_NULL)
{
StrResult = (char *)_bstr_t(TheValue);
StrDateTimeTemp = StrDateTime + _T(" ") + StrResult;
Temp.DateTime.ParseDateTime(StrDateTimeTemp, LOCALE_NOUSEROVERRIDE, LANG_USER_DEFAULT);
}
TheValue = m_pRecordset->GetCollect("NOTE");
if(TheValue.vt != VT_NULL)
{
StrResult = (char *)_bstr_t(TheValue);
Temp.Note = StrResult;
}
pTemp[iSize] = Temp;
iSize ++;
m_pRecordset->MoveNext();
}Did you try debugging the application? Where is the crash happening?
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
Did you try debugging the application? Where is the crash happening?
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
How can I debug the application ? It worked properly when I debug in VC. When window starts, it just announces a message
capint wrote:
How can I debug the application ?
By setting a breakpoint and starting the debugger.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
capint wrote:
How can I debug the application ?
By setting a breakpoint and starting the debugger.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
capint wrote:
How can I debug the application ?
By setting a breakpoint and starting the debugger.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
I think his application is started as a service when windows starts, so it's a bit too late to open VC and attach the debugger ;)
Cédric Moonen Software developer
Charting control [v1.4] -
I think his application is started as a service when windows starts, so it's a bit too late to open VC and attach the debugger ;)
Cédric Moonen Software developer
Charting control [v1.4]May be. But I couldn't make out anything from what he said. :)
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
May be. But I couldn't make out anything from what he said. :)
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
The hint is in the title and in his previous message ;)
Cédric Moonen Software developer
Charting control [v1.4] -
Can you explain more ? Where to put the breakpoint & how to start the debugger ? I mean with the application (file with the extension .exe)
You can also print status messages using OutputDebugString[^] and use an external debugger like DebugView[^]to view those messages. Find out where exactly your application is crashing and start investigating that portion of code.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
May be. But I couldn't make out anything from what he said. :)
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
The hint is in the title and in his previous message ;)
Cédric Moonen Software developer
Charting control [v1.4]window != Windows for me. I actually thought he is talking about some window. Or may be that I'm not smart enough. :)
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
window != Windows for me. I actually thought he is talking about some window. Or may be that I'm not smart enough. :)
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
Naaah, it's just that you didn't use your CPMRU properly :)
Cédric Moonen Software developer
Charting control [v1.4] -
Naaah, it's just that you didn't use your CPMRU properly :)
Cédric Moonen Software developer
Charting control [v1.4]:laugh:
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
So have you ever tried to connect to database through ADO and make it run with window ? Plz give me some code examples :sigh:
-
I use ADO to connect to database. I connect successfully. But when I run my application with window there's an error : Debug error : This application has requested the Runtime to terminate it in an unusual way Some one plz explain for me & give me a solution :rose:
Have you seen this?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Have you seen this?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
:(( I've searched for many hours but I found no result ... Some one has mentioned that problem but they didn't solve it ...
Have you tried the hotfix from Microsoft?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Have you tried the hotfix from Microsoft?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne