|
Hello,
I have the Ascii Code from a character, for example: 101, which is e. How can I convert this int Value into a char or better CString ?
With best regards,
RedDragon2kx
|
|
|
|
|
itoa for int to string
never say die
|
|
|
|
|
Sorry but I think I wasn't clear enough. I need the integer(101) represtented as a char(e).
So I need to convert the ASCII code(101) back to the character it represents
|
|
|
|
|
what i understood is that u want to convert the ASCII value into char
char c=char(101);
another way
int i= 101;
char=static_cast<char>(101);
but keep in mind with range of c
never say die
-- modified at 6:15 Thursday 29th December, 2005
|
|
|
|
|
int asc_int;
CString S_temp;
S_temp.Format("%c",asc_int);
thats it
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
If you remember that a char is just an int with a smaller range, then assigning an int to a char is just that, a simple assignment.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
int i_value;
char c_value;
c_value = static_cast<char>(i_value);
Software Zen: delete this; // <a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" rel="nofollow">Fold With Us!</a>[<a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" target="_blank" rel="nofollow" title="New Window">^</a>]
|
|
|
|
|
If i have an access database with a table called "USER" with fields ID, AGE, NAME, ADDRESS, and i want address of all users with age = 23, a simple sql query will do (SELECT * FROM USER WHERE blah blah)..
But when I have data in a CSV File, how would i build this sql query? select * from what?
Any help or pointers in this direction is highly appreciated.
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Rajesh R. Subramanian wrote: But when I have data in a CSV File, how would i build this sql query? select * from what?
Hi Rajesh,
csv file is nothing, just a comma seperated data and whole line denotes a record.
for executing query AFAIK, you have to import that in access and proceed in similiar way you mentioned above.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi Alok,
ThatsAlok wrote: csv file is nothing, just a comma seperated data
Thanks for your reply, but I too know its Comma separated text data. My concern is that it would be faster to use CSV instead of Access database.
ThatsAlok wrote: you have to import that in access and proceed in similiar way you mentioned above.
Dude, I have exported values from Access and created the CSV because it would be faster. You are asking me to create a MDB out of it again
Best Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Rajesh R. Subramanian wrote: created the CSV because it would be faster.
How Come ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Rajesh is correct.
1. Create a CSV file by exporting 10000 records.
2. Perform data operation on your MDB and CSV file.
3. You will surely find csv to be faster since it is text based.
|
|
|
|
|
hi,
Use OpenRowSet for performing data operations on .CSV files. I do not know if you could edit data, but you could query for sure.
-- modified at 0:48 Thursday 29th December, 2005
|
|
|
|
|
Thank you so much. That was the keyword I was looking for.
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Hai,
CSV is just a text file...You cannot perform any operations on that.
I think you have to Convert that text File in Table/Excel Format..
For this ..first you have to check ...
1.weather your file is variable length/Fixed length....
(...means weather your file is following any format..or not)
2.How it is parsed...(with coma,semicolon, space,tab etc)
VamsiDhar.MBC
SoftwareEngineer
|
|
|
|
|
mbcvamsidhar wrote: CSV is just a text file...You cannot perform any operations on that.
Sir, it is possible to perform operations on that. Atleast query operations. This can be done by using the xls driver. (select * from Sheet1 where blah blah).
mbcvamsidhar wrote: 2.How it is parsed...(with coma,semicolon, space,tab etc)
CSV = Comma separated values. Parsed with comma.
Regards and Thanks
Rajesh R. Subramanian.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Sir, it is possible to perform operations on that. Atleast query operations. This can be done by using the xls driver. (select * from Sheet1 where blah blah).
Can you Give me the syntax ....how to connect..etc
Thanks and Rgds
VamsiDhar.MBC
SoftwareEngineer
|
|
|
|
|
You can use the ODBC Text file driver to query the csv directly. However, it only gives you read access to the csv.
onwards and upwards...
|
|
|
|
|
Yes master,
I am using the same. But what would be the sql query format? SELECT * FROM what WHERE ...
Thanks and Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Example assumes that the CSV file is C:\Data\MyData.csv:
select * from C:\Data\MyData.csv
Also, using the ODBC DSN config utility, you can define the names and data types of the columns in the file. If you do this, you can access the column names in your sql statement and get back converted data types. Otherwise, I believe it just returns columns named F1, F2, F3, etc, all being varchar(255).
onwards and upwards...
-- modified at 9:44 Thursday 29th December, 2005
|
|
|
|
|
Hai,
Iam developing VC application which Selects any .MDB Database(MS-Access).
The requirement is..My Application should popup the list of Tables which contains primaryKey.
Can you pls tell me how to the retreive each table information in Access. (From MS-SQL i acheived this..using SQLGetPrimaryKeys()).....!
But this API is not Supporting For Access...
VamsiDhar.MBC
SoftwareEngineer
|
|
|
|
|
Hi,
I looked at the asm code in VC Disassembly for the following codes:
i++;
i = i+1;
Both are same.
10: i++;
0040D75F mov eax,dword ptr [ebp-8]
0040D762 add eax,1
0040D765 mov dword ptr [ebp-8],eax
11: i = i+1;
0040D768 mov ecx,dword ptr [ebp-8]
0040D76B add ecx,1
0040D76E mov dword ptr [ebp-8],ecx
But I studied in my computer classes that i++ is faster than = i+1.
How?
Thank you.
- NS -
|
|
|
|
|
it depends on the context.
like for example
k = somefunctioncall(i+1);<br />
i = i +1;
or
k = somefunctioncall(++i);
so here the secound one is faster than the first one
-Prakash
-Prakash
-- modified at 6:22 Wednesday 28th December, 2005
|
|
|
|
|
It has been a while since I did any C++ admitidly, I'm sure that the second example will pass a difference value into somefunctioncall because i++ is a postfix operation, i is passed into the function then updated, while i+1 will evaluate first then get passed into the function.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
|
|
|
|