|
Whitesky,
You please once again go through my Coding.. In that, i have created a table using the SQL Query "CREATE TABLE".. As well as i opened the Excel File created through my project and check with that.. I went to the Menu "Insert -- Name -- Define" and go through it.. There is a table created by the name "Pin_List", which representing all the rows and columns that are created..
Sorry for you troubling you again,
Sorry..
With Regards,
Sangeetha.
|
|
|
|
|
I think "Insert -- Name -- Define" on excel is for grouping,Right?I suggest on the excel see Menu Data->Table or Data-PivotTable.I guess your problem is in excel file excel if you saw previous link on excel file he declare columns with Table name.
|
|
|
|
|
Whitesky,
Even in there exe, the sorted result is coming only in the listbox of the dialog. And it is not getting updated in that "Readexcel.xls" file.. You please run that exe and check it out.
With Regards,
Sangeetha.
|
|
|
|
|
yes I saw did you see excel file in this project its strucutre is same with your excel
|
|
|
|
|
Yes.. But they are sorting the file that is created already.. But in my case, in that function am creating the excel file.. then i need to sort..
With Regards,
Sangeetha.
|
|
|
|
|
Is it correct? (1)you have a excel file(you have items and also table on it)(2)you can open this file(3)you can read of it(4)but you can sort items (or better you get runtime error) if you dont use of m_recordset.m_strSort what happens it work or doesnt work
|
|
|
|
|
Whitesky,
Now am very much confused. Is it possible to see the sorted result in the excel file..?
With Regards,
Sangeetha.
|
|
|
|
|
Hi WhiteSky,
I could accomplish the sorting task through the following code:
sExcelFile = "F:\\PinListTested\\10-25\\aaa.xls";
sSql.Format("DRIVER={%s};DSN='';FIRSTROWHASNAMES=1;READONLY=FALSE;CREATE_DB=\"%s\";DBQ=%s", sDriver,sExcelFile,sExcelFile);
TRY
{
//database.Close();
// Open the database using the former created pseudo DSN
database.OpenEx(sSql,CDatabase::noOdbcDialog);
// Allocate the recordset
// Allocate the recordset
CRecordset record( &database );
// Build the SQL string
// Remember to name a section of data in the Excel sheet using
// "Insert->Names" to be able to work with the data like you would
// with a table in a "real" database. There may be more than one table
// contained in a worksheet.
sSql = "SELECT NET_NAME,DUT_PIN,TESTER_CHANNEL,TRACE_LENGTH "
"FROM Pin_List "
"ORDER BY DUT_PIN";
record.Open(CRecordset::forwardOnly,sSql);
sSql = "CREATE TABLE DUTPin_List (NET_NAME TEXT,DUT_PIN TEXT,TESTER_CHANNEL TEXT,TRACE_LENGTH float)";
database.ExecuteSQL(sSql);
while( !record.IsEOF() )
{
// Read the result line
CString Sql("INSERT INTO DUTPin_List (NET_NAME,DUT_PIN,TESTER_CHANNEL,TRACE_LENGTH) VALUES (");
record.GetFieldValue("NET_NAME",str1);
str1 = "'" + str1 + "',";
Sql += str1 ;
record.GetFieldValue("DUT_PIN",str1);
str1 = "'" + str1 + "',";
Sql += str1;
record.GetFieldValue("TESTER_CHANNEL",str1);
str1 = "'" + str1 + "',";
Sql += str1;
record.GetFieldValue("TRACE_LENGTH", str1);
str1 = str1 + ")";
Sql += str1;
database.ExecuteSQL(Sql);
// Skip to the next resultline
record.MoveNext();
}
record.Close();
database.Close();
}
CATCH(CDBException, e)
{
// A database exception occured. Pop out the details...
AfxMessageBox("Database error: " + e->m_strError);
}
END_CATCH;
With Regards,
Sangeetha.
|
|
|
|
|
Congratulation,
Finally you write sort.
|
|
|
|
|
Hi Whitesky,
I have posted the code in the previous reply. In that, the data is getting sorted. But am storing it in an another table. Because i didnt know to replace the contents in the "Pin_List" table, since it is linked to the record object.
With Regards,
Sangeetha.
|
|
|
|
|
Yes I saw you used of Create Table if your problem is for writting to excel file on the Codeproject you can see examples of it. (but I think you can use of another ways search on www.codeproject.com or www.codeguru.com or www.codersource.net In these sites you can see Database Folder that they have examples of excel)
|
|
|
|
|
Hi Whitesky,
I searched.. There are no such examples.. Please excuse me to say this.. Am looking for to coloring specified rows as well as to see the change in the same table instead of creating the second table.
With Regards,
Sangeetha.
|
|
|
|
|
how can we perform a task at specific time suppose 11pm.
i have to make a application which should execute another application at specific time.
if anyone have idea about this please share with me.
thanks & regards
bankey.
|
|
|
|
|
Banks K wrote: how can we perform a task at specific time suppose 11pm.
You can create a windows service to check for the time. If the time in the system clock is what you need and it matches with what the user has scheduled, you can execute another application as you say.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Could use Task Scheduler or...
If your app is always running, you could create a timer and check for a specific time in the OnTimer event, then use ShellExecute to run the other application.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
thanks for quick reply,
u are right i have to use task scheduler but i have no idea about task scheduler,
please suggest me how can i use task scheduler.
|
|
|
|
|
Is ITaskScheduler helpfuls?
|
|
|
|
|
Hello everyone,
I am using C/C++ on Windows. I am wondering how to get the function call stack from my application.
For example,
if function foo call function goo, then function goo call function zoo, in function goo, I want to output the function call stack (foo --> goo --> zoo), and in goo, output the function call stack (foo --> goo).
Are there any samples of how to implement that? Does Windows runtime support this feature?
thanks in advance,
George
|
|
|
|
|
Can somebody help me in the case that i want that the path of the selected item in the treecrtl should get updated or what we say get selected inthe combobox box ..
How to achieve that....
Thanks in Advance
Saniaaa
|
|
|
|
|
saniaa wrote: what we say get selected inthe combobox box ..
CComboBox::GetCurSel();
or if you want to Search for a string in the list box of a combo box and, if the string is found, select the string in the list box and copy the string to the edit control you can use,
CComboBox::SelectString();
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks for ur reply ...
The Datlist of the combobox does not contain the item which is get selected in the treectrl . The way u have given is for that situation.
Here combobox just contain C:\,D:\ like this dataitems in it. and when the selection in the treectrl gets changed i want the changed or selected item path should get updated in the combobox .
Is there any way to achieve this..
Thanks
Shikha
|
|
|
|
|
Here it is.
CString csTreeItem = m_ObjTree.GetItemText(m_ObjTree.GetSelectedItem());
CString csComboItem;
for( int nInd =0; nInd < m_ObjCombo.GetCount(); nInd++ )
{
ObjCombo.GetLBText(nInd, csComboItem);
if( 0 == csComboItem.compare(csTreeItem ))
{
ObjCombo.SetCurSel(nInd );
break;
}
}
|
|
|
|
|
Thanks for ur reply..
Acccording to ur way as per my understanding my combobox should have the selected item from the treectrl in its datalist ,and then comparing it with the one selected , it is updating in comboboox.
But if i have the simple combbox datalist which just have the datlist items like C:\ ,D:\ not the whole contents of the drives ... in such sitution do we manage it ???
Thanks
Saniaa
|
|
|
|
|
Sorry. I don't get ur need clearly.
if the selected tree control item not in ur combo box,
You want to add it in the combo and select that one?? or map to any other item??
|
|
|
|
|
Hi,
I'm not sure ... you've got a combobox only with drive letters and on treectrl full path, and when you select some path on tree, in combobox should appear full path ?
If yes:
- HTREEITEM GetSelectedItem() - you'll get selected item handle
- CString GetItemText( HTREEITEM hItem ) - you'll get item text
- HTREEITEM GetParentItem( HTREEITEM hItem ) - you'll get parents' item handle
- CString GetItemText( HTREEITEM hItem ) - you'll get item text
...
unless your parents' item handle will equal with root
- HTREEITEM GetRootItem( )
when you'll get all path, you can send all text to combobox
- int InsertString( int nIndex, LPCTSTR lpszString )
and select
- int SetCurSel( int nSelect );
-----------
Mila
|
|
|
|