Click here to Skip to main content
15,915,600 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWhitebox testing tools for vc++ application [modified] Pin
ptr_Electron29-Sep-06 0:37
ptr_Electron29-Sep-06 0:37 
AnswerRe: Whitebox testing tools for vc++ application Pin
ShilpiP29-Sep-06 0:49
ShilpiP29-Sep-06 0:49 
GeneralRe: Whitebox testing tools for vc++ application Pin
<color>Aljechin 29-Sep-06 2:22
<color>Aljechin 29-Sep-06 2:22 
GeneralRe: Whitebox testing tools for vc++ application Pin
ptr_Electron29-Sep-06 2:56
ptr_Electron29-Sep-06 2:56 
GeneralRe: Whitebox testing tools for vc++ application Pin
ShilpiP29-Sep-06 21:08
ShilpiP29-Sep-06 21:08 
QuestionColoring Excel rows through Visual C++ Pin
Sangeetha_J29-Sep-06 0:34
Sangeetha_J29-Sep-06 0:34 
AnswerRe: Coloring Excel rows through Visual C++ Pin
Rajesh R Subramanian29-Sep-06 1:02
professionalRajesh R Subramanian29-Sep-06 1:02 
GeneralRe: Coloring Excel rows through Visual C++ Pin
Sangeetha_J29-Sep-06 1:07
Sangeetha_J29-Sep-06 1:07 
Yeah,

The coding is as follows:

CDatabase database;
CString sDriver = "MICROSOFT EXCEL DRIVER (*.XLS)";

CString sExcelFile = FileName;
CString sSql;

CString str1;

TRY
{
// Build the creation string for access without DSN

sSql.Format("DRIVER={%s};DSN='';FIRSTROWHASNAMES=1;READONLY=FALSE;CREATE_DB=\"%s\";DBQ=%s", sDriver,sExcelFile,sExcelFile);

// Create the database (i.e. Excel sheet)
if( database.OpenEx(sSql,CDatabase::noOdbcDialog) )
{
// Create table structure

int j = database.CanUpdate();

CAngle_CheckSet1* recset;
recset = new CAngle_CheckSet1(&database);

recset->Open(NULL,NULL,NULL,"'TABLE','SYSTEM TABLE'",CRecordset::snapshot);
CString TableName, sSql;

TableName = "\0";

if(!recset -> IsEOF())
{

recset->MoveFirst();

while(!recset->IsEOF())
{

TableName = "[" + recset->m_strTableName + "]";
recset->MoveNext();
}

}

recset->Close();

if(TableName == "[90_Degree]")
{

sSql = "DROP TABLE 90_Degree";
database.ExecuteSQL(sSql);

}

sSql = "CREATE TABLE 90_Degree (NET_NAME TEXT,X1 float,Y1 float, X2 float,Y2 float, LAYER TEXT)";
database.ExecuteSQL(sSql);



Here we can create table and send the data and had taken the output in excel also. But how to write the sql statement for coloring any of the rows.

ArraySize = m_NinetyArray.GetSize();

for(int i = 0; i < ArraySize; i++)
{

ErrorClass = (CError*) m_NinetyArray.GetAt(i);

// Insert data
CString Sql("INSERT INTO 90_Degree (NET_NAME, X1, Y1, X2, Y2, LAYER) VALUES (");
Sql = Sql + "'" + ErrorClass -> NetName + "'," + "%f,%f,%f,%f";
sSql.Format(Sql, ErrorClass -> X1 , ErrorClass -> Y1, ErrorClass -> X2, ErrorClass -> Y2);
Sql = sSql + "," + "'" + ErrorClass -> Layer + "'" + ")";
sSql = Sql;
database.ExecuteSQL(sSql);

}

sSql = "pset border 1";
database.ExecuteSQL(sSql);

sSql = "SELECT * FROM 90_Degree";
database.ExecuteSQL(sSql);

}

// Close database
if(database.IsOpen())
database.Close();

}

CATCH_ALL(e)
{

TRACE1("Driver not installed: %s",sDriver);
}

END_CATCH_ALL;

With Regards,
Sangeetha.

GeneralRe: Coloring Excel rows through Visual C++ Pin
Rajesh R Subramanian29-Sep-06 1:23
professionalRajesh R Subramanian29-Sep-06 1:23 
GeneralRe: Coloring Excel rows through Visual C++ Pin
Sangeetha_J29-Sep-06 1:28
Sangeetha_J29-Sep-06 1:28 
GeneralRe: Coloring Excel rows through Visual C++ Pin
Rajesh R Subramanian29-Sep-06 1:35
professionalRajesh R Subramanian29-Sep-06 1:35 
JokeRe: Coloring Excel rows through Visual C++ Pin
<color>Aljechin 29-Sep-06 1:45
<color>Aljechin 29-Sep-06 1:45 
GeneralRe: Coloring Excel rows through Visual C++ Pin
Naveen29-Sep-06 1:54
Naveen29-Sep-06 1:54 
GeneralRe: Coloring Excel rows through Visual C++ Pin
<color>Aljechin 29-Sep-06 1:59
<color>Aljechin 29-Sep-06 1:59 
GeneralRe: Coloring Excel rows through Visual C++ Pin
Rajesh R Subramanian29-Sep-06 1:32
professionalRajesh R Subramanian29-Sep-06 1:32 
QuestionHow to write a msconfig program Pin
hmt200429-Sep-06 0:03
hmt200429-Sep-06 0:03 
AnswerRe: How to write a msconfig program Pin
Naveen29-Sep-06 0:20
Naveen29-Sep-06 0:20 
GeneralRe: How to write a msconfig program Pin
Naveen29-Sep-06 0:24
Naveen29-Sep-06 0:24 
GeneralRe: How to write a msconfig program Pin
hmt200429-Sep-06 0:26
hmt200429-Sep-06 0:26 
GeneralRe: How to write a msconfig program Pin
Naveen29-Sep-06 0:33
Naveen29-Sep-06 0:33 
GeneralRe: How to write a msconfig program Pin
hmt200429-Sep-06 0:46
hmt200429-Sep-06 0:46 
GeneralRe: How to write a msconfig program Pin
Naveen29-Sep-06 0:53
Naveen29-Sep-06 0:53 
GeneralRe: How to write a msconfig program Pin
David Crow29-Sep-06 2:48
David Crow29-Sep-06 2:48 
GeneralRe: How to write a msconfig program Pin
Hamid_RT29-Sep-06 0:51
Hamid_RT29-Sep-06 0:51 
AnswerRe: How to write a msconfig program Pin
ShilpiP29-Sep-06 1:10
ShilpiP29-Sep-06 1:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.