Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
How to Use ODBC Layer

How to Use ODBC Layer

Ratings: (0)|Views: 35 |Likes:
Published by api-3715867

More info:

Published by: api-3715867 on Oct 14, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

#include "midb\dbhashtable.h"
cdbhashtable* pht = new cdbhashtable;
pht->clear();
cdbcomfunctions

m_pdbfunction;
cstring sdynsqlstr.format("select * from t1");
cdbresultset* prset = m_pdbfunction.getsqlresultset(sdynsqlstr);
if(prset->getstatus())
{

prset->filldbhashtable(pht);
}delete prset;
//extracting hash table extraction

// using column index
int nrows = pht->getint("data.row.count");
int ncols = pht->getint("data.column.count");
cstring skey;
for(int krow = 0; krow < nrows; krow++)
{

skey.format("data.row.%d", krow);
cstringarray* pstrary = pdataht->getstringarray(skey);
cstring col0 = pdataary->getat(0);
cstring col1 = pdataary->getat(1);

} // do for number of data rows
// using column index
// using column name
cstring skey;
cdbrecordmap m_precmap;
m_precmap.setnameary("5", "apptype", "optiontype", "comboorder", "dbitem",
"comboitem");
for(int krow = 0; krow < nrows; krow++)

{
skey.format("data.row.%d", krow);
cstringarray* pstrary = pdataht->getstringarray(skey);
m_precmap.setvalueary(pstrary);
sapptype

= m_precmap.getstring("apptype");

soptiontype = m_precmap.getstring("optiontype");
} // do for number of data rows
// using column name

how to insert / delete

cdbpool* ppool = cdbpool::getinstance();
idbconnection* m_pdbconn = ppool->getconnection();
cstring sdynsqlstr("delete from t1 where id = 10");
if(sdynsqlstr.getlength() > 0) { bresult = m_pdbconn-

>executesql(sdynsqlstr); }

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->