|
Hi, all
I am trying to update an Access file. After i called
AddNew()function, there is no any change in the Access file. But when i did test by calling MoveLast(), the new inserted record is there. It seems like AddNew() function does not change the original Access file. Is it right? How can i update the original Access file.
Thanks. Happy holidays!
|
|
|
|
|
did you called rs.Update() after AddNew(); ?
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Yes, i did. Actually, i already figured it out. The problem is from Access. I tyied my function with Access 97, it works.
Thank you for your suggestion. Have nice holidays.
|
|
|
|
|
Hi everyone,
My pseudo code and question are folowing:
//Code_Start
void CTryDlg::OnStart3()
{
CFile f;
DWORD dwStatus;
DWORD dwBuffLen = sizeof(dwStatus);
BOOL bSuccess;
CHttpConnection *cn;
CHttpFile *httpf;
CString strSentence,strGetSentence;
CString strHttpName = "http://www.eee.com/login.asp";
char opt[] = "UserName=uuu&Password=ppp";
CString strHeaders = "Content-Type: application/x-www-form-urlencoded\r\n";
CInternetSession session("IE 5.0");
try {
cn = session.GetHttpConnection("www.dailygraphs.com",0,INTERNET_DEFAULT_HTTP_PORT,NULL,NULL);
httpf = cn->OpenRequest(CHttpConnection::HTTP_VERB_POST,"login.asp",NULL,1,NULL,NULL,INTERNET_FLAG_EXISTING_CONNECT|INTERNET_FLAG_KEEP_CONNECTION|INTERNET_FLAG_NO_CACHE_WRITE|INTERNET_FLAG_FORMS_SUBMIT);
httpf->SendRequest(strHeaders,(LPVOID)(LPCTSTR)opt,strlen(opt));
bSuccess = httpf->QueryInfo(HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER,&dwStatus, &dwBuffLen);
strGetSentence = "";
if( bSuccess && dwStatus>= 200 &&dwStatus<300 )
{
while(httpf->ReadString(strSentence)){
strGetSentence = strGetSentence + strSentence + char(13) + char(10);
}
}
} catch (CInternetException *e) {
TRACE("err code is %d",e->m_dwError);
}
f.Open("out.htm",CFile::modeCreate|CFile::modeWrite);
f.Write(strGetSentence,strGetSentence.GetLength());
f.Close();
}
//Code_End
Maybe you have understood what I want.Just post data and get response from server.But result is out.htm is empty,I can not get response.
What's the problem with my code?
Thanks!
|
|
|
|
|
Hi,
I am trying to update(add,edit,delete) records to MS Access database from a dialog box. I created a dialog box by using AppWizard. Also, i created a derived class of CRecordset by using ClassWizard. The following is my ONOK function:
void CComplaintDlg::OnOK()
{
complaintRecord cr;
cr.Open();
cr.AddNew();
UpdateData();
cr.m_CallerName = m_Complaint_Name;
cr.Update();
cr.Requery();
cr. Close();
CDialog::OnOK();
}
After i compile and run it, it does not update the original data file. What did i do wrong?
Thanks in advance.
Happy holidays!
csgogogo
|
|
|
|
|
Did you select DynaSet while making the DAO class or did you selected Snapshot?
check ur default SQL string in complaintRecord Class !
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
When I use the MAPISendMail command with the MAPI_DIALOG flag it brings up the dialog in Outlook (loading mapi32.dll library) and Outlook Express (loading msoe.dll library). If the mail client is closed, the message will send in Outlook Express, but will sit in the outbox of Outlook until the program is opened and the send/receive button is pressed.
How can I change this behavior?
I can't create a new process of outlook.exe because I do not know if the mail has been sent before killing the process...
Help please. Thank you in advance...
~LizardWiz()
|
|
|
|
|
One solution is to drop MAPI and use SMTP instead. PJ Naughter has written a very handy, easy to use, MFC class that wraps the SMTP protocol. You can get it at http://www.naughter.com/smtp.html[^].
The only potential drawback on using this class is that the mail sent is not stored in your OE Sent Items folder so you will have to devise your own method of logging out going emails if you want to keep track of them.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks for the reply but unfortunately the people who I am doing this project for want the Outlook message email dialog to come up (the one with the <SEND> button), hence the need for the MAPI.DLL...unless someone has a better idea.
Too bad your a Canucks fun but I am willing to overlook that fact because you are a hockey fan...Go Kings!
~LizardWiz()
|
|
|
|
|
I am doing a c++ program and i met some problems in order to call the declaration function. what should I do in order to call the implementation function properly?
Thank you for you all helping.
in the declaration part,.....
mxArray * mlfImproved_DA1(mxArray * * targets,
mxArray * train_features,
mxArray * params) {
int nargout = 1;
mxArray * features = mclGetUninitializedArray();
mxArray * targets__ = mclGetUninitializedArray();
mlfEnterNewContext(1, 2, targets, train_features, params);
if (targets != NULL) {
++nargout;
}
features = Mimproved_DA1(&targets__, nargout, train_features, params);
mlfRestorePreviousContext(1, 2, targets, train_features, params);
if (targets != NULL) {
mclCopyOutputArg(targets, targets__);
} else {
mxDestroyArray(targets__);
}
return mlfReturnValue(features);
}
in the main program......
mwArray *features;
mwAarray **targets; //109
features = mlfImproved_DA1( targets, x, m1 ); //110
……………..
after Compiling...
matlabfunction.cpp
C:\foo\matlabwizard\matlabfunction.cpp(109) : error C2065: 'mwAarray' : undeclared identifier
C:\foo\matlabwizard\matlabfunction.cpp(109) : error C2100: illegal indirection
C:\foo\matlabwizard\matlabfunction.cpp(110) : error C2664: 'mlfImproved_DA1' : cannot convert parameter 1 from 'class mwArray' to 'struct mxArray_tag ** '
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Error executing cl.exe.
matlabfunction.obj - 3 error(s), 0 warning(s)
Vincent Sim
|
|
|
|
|
What is mwAarray?
Kuphryn
|
|
|
|
|
mwArray is the variable declaration used for MATLAB C++ LIBRARY.
merry xmas , kuphryn
vincent sim
|
|
|
|
|
;)
Don't you know about mwarray, let me give you a big good referece. see the book written by Deitel .
I really want to discuss visual C++.
|
|
|
|
|
Is the problem that mwAarray could possibly be misspelled? Should it be mwArray?
That is probably your problem I think although I am not sure if mwArray is a compatible type with mxArray_tag. All of your problems seem to be stemming from a misspelled var type though.
~LizardWiz()
|
|
|
|
|
2 problems are obvious:
mwAarray is not declared. looks misspelled to me
also, the function you are using needs a variable of type mxArray** instead of mwArray** which you are sending.
It also returns mxArray* instead of mwArray* which you are trying to stuff the return into.
|
|
|
|
|
Hi guys,
I hope this is not difficult to do. How do I make the widths of columns in a list control (Report view) fixed? Which the users cannot change them (no change width type of cursor).
Thanks in advance
and Merry Christmas everyone
|
|
|
|
|
Check out CodeProject code section.
http://codeproject.com/listctrl/headerctrl.asp
Kuphryn
|
|
|
|
|
How do I get page breaks to print correctly in CEditView? I checked to Wordpad example but can't find the code that does the work.
Thanks
Kevin
|
|
|
|
|
While Printing by MFC you have to do the Pagination by urself
i.e. Override OnPrepareDC or OnBeginPrinting and set the no of pages stuff
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
I got that far. I was trying to see how it was done in the Wordpad example. At this point I believe it has to do with using the RichEditCtrl as opposed to CEditView.
|
|
|
|
|
Hi everyone! I have a question regarding HPTestExec and C++. My task is to create an action to be executed in HPTestExec, this action will call the C++ code. I would need to write C++ code to call up Windows Media Player. To do it programmatically, I would need to download and install the Microsoft DirectX SDK and write code using this API. Does anyone have suggestions on how I would go about doing that? Or would there be a simpler way of achieving it? Thanks for your time.
|
|
|
|
|
You could instantiate the Windows Media Player ActiveX Control if ur design allows it , it should be simple enough or you just have to use C++ code in that case u r stuck with SDK
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Hi!
In my application I have to convert several normal one-byte ascii strings to unicode strings.
I do this like follows:
lptTitle = A2W(ptrTitle);
lptURL = A2W(ptrURL);
lptUserName = A2W(ptrUserName);
lptPassword = A2W(ptrPassword);
lptAdditional = A2W(ptrAdditional); All variables prefixed with lpt are of type LPTSTR and all prefixed with ptr are of type CHAR*.
A2W is defined as:
#define A2W(lpa) ( ((LPCSTR)lpa == NULL) ? NULL : ( _convert = (lstrlenA(lpa)+1), ATLA2WHELPER((LPWSTR) alloca(_convert*2), lpa, _convert)))
Now my question: the A2W macro allocates memory, but when does it free it??? Doesn't this macro result in memory leaks??
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
MSDN
_alloca allocates size bytes from the program stack. The allocated space is automatically freed when the calling function exits (not when the allocation merely passes out of scope). Therefore, do not pass the pointer value returned by _alloca as an argument to free.
Thank You
Bo Hunter
This is what Heath Stewart thinks about Certifications.
Heath Stewart said
"Personally, I am not certified because I really don't want to be. I know a large number of people with certifications that know crap. They studied for the tests, memorized a few things, took the tests (sometimes a couple times) and got their certs. They're still idiots."
|
|
|
|
|
Wonderful, thank you!
Can I use the A2W and W2A macros more than one time in my function? Like in my example?
[EDIT]Ok, no more a problem. I've solved it another way.[/EDIT]
Thanks for your reply!
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|