|
No i have already done file copying.
In file copying the exist data is removed.
So i want write data from source file to dest file,without losting of existing data of dest file.
So please tell me how can i do this ?
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
"_$h@nky_" wrote: In file copying the exist data is removed.
Who removed it?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I mean the dest file is replaced by source file in file copying,
and existing data of dest file is lost.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hence you don't need a copy: you need to add the whole content of a database to another, not-empty, one. I think you should do it without bypassing the database engine (i.e. you have to use SQL or an Access tool).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Please tell me how can i do this from SQL command.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
I think the best approach is
Search for an Access import/export tool and then use it.
If you cannot exploit the above then use SQL , but it won't be a painless task, I presume.
[added]
"_$h@nky_" wrote: IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
It looks like you're travelling in the right path today.
[/added]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Thursday, July 31, 2008 8:17 AM
|
|
|
|
|
"_$h@nky_" wrote: So i want write data from source file to dest file,without losting of existing data of dest file
wait, isn't that a copy for you (a copy of data) ???
you take the entiere source file content, and you write it entierely into the destination file as is. right ?
|
|
|
|
|
Yes
toxcct wrote: take the entiere source file content, and you write it entierely into the destination file
i want to copy all data of souce file in dest file,without losting existing like.
like appending.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
ah, you want to append the source file to the dest one.
hum, I could always propose the bare solution, which will copy the data like needed, but i'm not sure the destination mdb will be still valid afterward.
is it a binary file of a text file ?
and do you know the structure of the file (how the data are set inside the file) ??
oh and by the way, where are those .mdb file coming from ?
|
|
|
|
|
sir,
In my application i m using access database so i use .mdb file,
in case of restoration i want copy of old data of old file into new file with new data.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Since it's just an Access file, use the ODBC driver. Derive a class from CRecordset .
"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
|
|
|
|
|
this is wat i tried..dint work
void CMenuDlg::OnOK()
{
CDisplayDlg dlg;
UpdateData();
dlg.m_List.AddString(m_name);
dlg.m_List.AddString(m_dept);
UpdateData(FALSE);
CDialog::OnOK();
}
modified on Thursday, July 31, 2008 3:43 AM
|
|
|
|
|
Hi, the post title should be meaningful, did you read posting guidelines?
BTW:Kausalya Srinivasan wrote: void CMenuDlg::OnOK()
{
UpdateData();
CDisplayDlg dlg;
dlg.m_List.AddString(m_name);
dlg.m_List.AddString(m_dept);
UpdateData(FALSE);
}
The above is not the way to go.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
then how do u do it...without using files
|
|
|
|
|
man, you've been on this forum for few hours only, and still you don't listen to the advices people gave you...
modified on Thursday, July 31, 2008 3:43 AM
|
|
|
|
|
hi,
as CPallini stated, please first read the Posting Guidelines[^].
then edit (not repost) your message consequently.
now, a question.
why are you declaring dlg (which is not even initialized) ?
is the list you want to add items into located in another dialog ?
if it's not, just replace dlg by this (or remove it, it will be implicit). otherwise, you have to rethink your technical design. things cannot be done like this.
|
|
|
|
|
WHY oh WHY did you deleted your post ????
are you that selfish to ask a question on a forum and not to share the answers ?
I told you to edit your message, not to repost a new one, but that was obvious to me that i wasn't at all telling you to move out (with your question !).
when I told edit your message, it meant to put the code sample into <pre></pre> tags...
come on, please edit your message again !
thank you for editing.
now please reply my first post, because i don't understand what dlg is there for...
modified on Thursday, July 31, 2008 4:10 AM
|
|
|
|
|
ab_pq wrote: dint work
No surprise there. Where do you call DoModal() ? Why are you calling AddString() on a control that does not exist?
"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
|
|
|
|
|
Hi all,
i have made a sdi application, but have changed its menu bar. my problem is when i press ctrl+s save as window pops up.
How can i remove this shortcut working.
Thanks in advance
|
|
|
|
|
VCProgrammer wrote: my problem is when i press ctrl+s save as window pops up.
How can i remove this shortcut working.
Goto your resource tab, open "Accelerator" resource, delete the line ID_FILE_SAVE Ctrl + S VirtKey, and recompile.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Hi all,
How can i know a purticular file exist at selected location?
For example:: test.txt is a file, i want to save it in MyDocuments.
so, how can i check before saving of test.txt, test.txt is exist in MyDocuments or not.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
I already told you it can be done by using FindFirstFile API. If the file does not exists INVALID_HANDLE_VALUE is the return value else you get a handle to the file.
Why a new thread is needed to post a query?
The previous thread was not too long [That of - Only copying done not replacing in SHFileOperation !!!]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
CString m_strFile = _T("C:\\path\\to\\file.txt");
if (::PathFileExists(m_strFile)) {
}
else {
}
|
|
|
|
|
The "classic" Win32 way (without MFC):
1. use GetFileAttributes()
2. check the return value
3. if it is 0xFFFFFFFF then check what
4. GetLastError() returned (if the file does not exist, it would be ERROR_FILE_NOT_FOUND )
|
|
|
|
|
Have you tried _access() ?
"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
|
|
|
|