|
Digging some more it seems ADO is the way to go. Alternatively I buy a copy of this[^] which will give us support for lots of different databases and is cross-platform, which would be useful for this particular project...
|
|
|
|
|
You may also use ODBC [^].
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]
|
|
|
|
|
ADO wraps OLE DB to present a VB- and scripting-friendly interface. From C++ you may find that the OLE DB Consumer Templates are actually easier to use: you don't have to go through the Automation data types.
There's even a book[^].
Unfortunately not very many people seem to know about this, so you may find help difficult to come by.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Here's a place you can compare the non-.NET data access technologies
specific to Windows...
Windows Data Access Components SDK[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Hi ,
I have to display some data in an edit box.
The buffer contains 10,13 characters in between.
So I am displaying as it is.
Suppose I have in my buff "red\r\nblue\r\ngreen",
the display must be
red
blue
green. like this.
But my edit box displaying it in a single line like "red\r\nblue\r\ngreen",
How can I do it?
Please help me.
Regards,
Sunil Kumar
|
|
|
|
|
If the code is not confidential, can you show it to us, please?
|
|
|
|
|
You need to set the ES_MULTILINE style. It's one of the check boxes in the designer, or use the style in your CreateWindow call.
(If that still fails, try \r\n, but it should work).
Iain
|
|
|
|
|
Hi,
Yeah if I define as multiline it is working.
But it is working only if I give manually like
SetWindowText("red\r\nblue\r\ngreen");
But if i get the data from external source via UART I am collecting in a buffer.
Buffer contains the chars 10,13 after each word.
Then I directly do SetWindowText(buffer);In that case it is displaying in a single line,
not in multilines.
So what should be done if I have to display the data in multilines whenever i come across 10,13 characters.
Please help!
Regards,
Sunil Kumar
|
|
|
|
|
Replace 10 with \r and 13 with \n ?
|
|
|
|
|
Hi Rajesh,
Is there any difference between 10 and '\r' , 13 and '\n'.
I think they are ascii euqivalents only na??
In the buffer if I replace 10 with '\r', in the debug mode I am able to see 10 only as it is the ascii
euivalent.
Regards,
Sunil Kumar
|
|
|
|
|
So, that was the reason why I asked you for the code. Also, I'd like to see how this 10 and 13 are coming within a string. It is impossible to tell you anything without looking at your code.
|
|
|
|
|
sunilkumar.d wrote: Is there any difference between 10 and '\r' , 13 and '\n'.
Yes.
sunilkumar.d wrote: I think they are ascii euqivalents only na??
You're wrong:
10 is the ASCII code for '\n'
13 is the ASCII code for '\r' .
(i.e. you're getting the characters in the reverse order).
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]
|
|
|
|
|
My first thought was "Hmph, of course it works..."
But I thought I'd get some evidence before acting all superior.
This does not work:
CString buf;
buf += "Hello";
buf += char (10);
buf += "There";
SetDlgItemText (IDC_EDIT7, buf);
This does not work:
CString buf;
buf += "Hello";
buf += char (13);
buf += "There";
SetDlgItemText (IDC_EDIT7, buf);
This does not work:
CString buf;
buf += "Hello";
buf += char (10);
buf += char (13);
buf += "There";
SetDlgItemText (IDC_EDIT7, buf);
This works!
CString buf;
buf += "Hello";
buf += char (13);
buf += char (10);
buf += "There";
SetDlgItemText (IDC_EDIT7, buf);
Which comes as a bit of a surprise to me... Needing both CR and LF is no shock, but which order? Quite a surprise.
How you solve it is up to you really. Your reading from the UART routine could simply swap char(10) with char(13) and vice versa.
Or your routine that puts the text into the screen could.
You could put it in a string, and do a replace like so:
while (1)
{
int nFind = MyString.Find ("\n\r");
if (nFind < 0) break;
MyString [nFind] = '\r';
MyString [nFind+1] = '\n';
}
The choices are (near) endless.
Iain.
|
|
|
|
|
Yeah Iain,
It is a bit surprise.
If I change the order , like if 10 is replaced with '\r' and 13 is replaced
with '\n', it is displaying in multilines.
Regards,
Sunil Kumar
|
|
|
|
|
Hi all,
i have to access file those extension are .mdb, how can i write data from one .mdb file to another,thru coding.
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
|
|
|
|
|
"_$h@nky_" wrote: how can i write data from one .mdb file to another,thru coding
you mean, pure file copy ?
or you want to copy internal parts of it only ?
if so, you must know the format of the file first...
|
|
|
|
|
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
|
|
|
|