XEROF

 

xlsgen 3.5 build #63 : MySQL support


Build 3.5.0.63 adds support for MySQL in data queries. And this means two things.

One, such a database system with no regular record cursor, implied to have data related APIs to xlsgen to be reworked to work with such a thing. So you can navigate rows of a table with an internal database record cursor, which was not possible before this build.

Second, a cursor related property is exposed in the table data source object in order to make it possible to enable a client cursor, whenever the server-side (MySQL is an example) does not have such thing.

Here is a piece of source code querying a sample MySQL database (sakila) :

xlsgen::IXlsEnginePtr engine( __uuidof(xlsgen::CoXlsEngine) );

xlsgen::IXlsWorkbookPtr wbk = engine->New( L"output.xls" );

xlsgen::IXlsWorksheetPtr wksht = wbk->AddWorksheet("Sheet1");

xlsgen::IXlsTablePtr table = wksht->NewTable[3][2];

table->DataSource->ConnectionString = L"Driver={MySQL ODBC 5.3 ANSI Driver};Server=127.0.0.1;Database=sakila;User=user1;Password=;Option=3";

table->DataSource->CommandTimeout = 40;
table->DataSource->ConnectionTimeout = 120;

table->DataSource->RecordCursor = xlsgen::datasourcecursor_client;

table->DataSource->SQLStatement = L"select * from country";

int nbrows = table->DataResults->RowCount; // <-- returns 109 not -1
int nbcolumns = table->DataResults->Columns->Count;

_bstr_t column1 = table->DataResults->Columns->Item[1]->Name;
_bstr_t column2 = table->DataResults->Columns->Item[2]->Name;
_bstr_t column3 = table->DataResults->Columns->Item[3]->Name;

wksht->InsertTableAt(table, 6, 2); // insert the sql table in the sheet at location [6,2]

wbk->Close();

Posted on 12-September-2014 23:56 | Category: xlsgen, Excel generator | comment[0] | trackback[0]

 

 

<-- previous page

< September >
0102030405
0607080910
1112131415
1617181920
2122232425
2627282930



 

 

This site
Home
Articles

DevTools
CPU-Z
EditPlus
ExplorerXP
Kill.exe
OllyDbg
DependencyWalker
Process Explorer
autoruns.exe
Araxis
COM Trace injection
CodeStats
NetBrute
FileMon/Regmon
BoundsChecker
AQTime profiler
Source monitor
GDI leaks tracking
Rootkit revealer
Rootkit removal
RunAsLimitedUser(1)
RunAsLimitedUser(2)

 

 

Liens
Le Plan B
Un jour à Paris
Meneame
Rezo.net (aggr)
Reseau voltaire
Cuba solidarity project
Le grand soir
L'autre journal
Le courrier suisse
L'Orient, le jour
Agoravox (aggr)