mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
OleDB: fixed for private Connection in Sql
git-svn-id: svn://ultimatepp.org/upp/trunk@4353 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
0b7b0f5af4
commit
5f0b18e7ae
5 changed files with 204 additions and 192 deletions
|
|
@ -1141,7 +1141,8 @@ Array<OleDBSession::Provider> OleDBSession::EnumProviders()
|
|||
OleDBSession dummy;
|
||||
One<OleDBConnection> conn = new OleDBConnection(&dummy);
|
||||
conn->Execute(rowset);
|
||||
Sql cursor(-conn);
|
||||
Sql0 cursor;
|
||||
Attach(cursor, -conn);
|
||||
int cname = -1, cdesc = -1, cguid = -1;
|
||||
for(int i = 0; i < cursor.GetColumns(); i++) {
|
||||
String ci = cursor.GetColumnInfo(i).name;
|
||||
|
|
@ -1351,7 +1352,8 @@ Vector<String> OleDBSession::EnumDatabases()
|
|||
OleVerify(srowset->GetRowset(NULL, DBSCHEMA_CATALOGS, 0, NULL, trowset.GetIID(), 0, NULL, trowset.SetUnk()));
|
||||
One<OleDBConnection> conn = new OleDBConnection(this);
|
||||
conn->Execute(trowset);
|
||||
Sql cursor(-conn);
|
||||
Sql0 cursor;
|
||||
Attach(cursor, -conn);
|
||||
int ccat = -1;
|
||||
for(int i = 0; i < cursor.GetColumns(); i++) {
|
||||
String n = cursor.GetColumnInfo(i).name;
|
||||
|
|
@ -1376,7 +1378,8 @@ Vector<String> OleDBSession::EnumTables(String database)
|
|||
OleVerify(srowset->GetRowset(NULL, DBSCHEMA_TABLES, 1, restrictions, trowset.GetIID(), 0, NULL, trowset.SetUnk()));
|
||||
One<OleDBConnection> conn = new OleDBConnection(this);
|
||||
conn->Execute(trowset);
|
||||
Sql cursor(-conn);
|
||||
Sql0 cursor;
|
||||
Attach(cursor, -conn);
|
||||
int cname = -1;
|
||||
int cschema = -1;
|
||||
int ctype = -1;
|
||||
|
|
@ -1418,7 +1421,8 @@ Vector<String> OleDBSession::EnumViews(String database)
|
|||
OleVerify(srowset->GetRowset(NULL, DBSCHEMA_TABLES, 1, restrictions, trowset.GetIID(), 0, NULL, trowset.SetUnk()));
|
||||
One<OleDBConnection> conn = new OleDBConnection(this);
|
||||
conn->Execute(trowset);
|
||||
Sql cursor(-conn);
|
||||
Sql0 cursor;
|
||||
Attach(cursor, -conn);
|
||||
int cname = -1;
|
||||
int cschema = -1;
|
||||
int ctype = -1;
|
||||
|
|
@ -1476,7 +1480,8 @@ Vector<String> OleDBSession::EnumPrimaryKey(String database, String table)
|
|||
trowset.GetIID(), 0, NULL, trowset.SetUnk()));
|
||||
One<OleDBConnection> conn = new OleDBConnection(this);
|
||||
conn->Execute(trowset);
|
||||
Sql cursor(-conn);
|
||||
Sql0 cursor;
|
||||
Attach(cursor, -conn);
|
||||
int cname = -1;
|
||||
int cord = -1;
|
||||
Vector<int> ordinal;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
NAMESPACE_UPP
|
||||
|
||||
void SqlSession::Attach(Sql& sql, SqlConnection *con)
|
||||
{
|
||||
sql.Attach(con); // Duck tape to fix OleDB
|
||||
}
|
||||
|
||||
SqlSession::SqlSession()
|
||||
{
|
||||
trace = NULL;
|
||||
|
|
|
|||
|
|
@ -610,7 +610,7 @@ bool Sql::IsOpen() { return cn && GetSession().Is
|
|||
|
||||
void SqlConnection::Attach(Sql& sql, SqlConnection *con)
|
||||
{
|
||||
sql.Attach(con);
|
||||
sql.Attach(con); // Duck tape to fix Oci8
|
||||
}
|
||||
|
||||
#ifndef NOAPPSQL
|
||||
|
|
|
|||
|
|
@ -322,6 +322,8 @@ protected:
|
|||
|
||||
void SessionClose();
|
||||
|
||||
static void Attach(Sql& sql, SqlConnection *con);
|
||||
|
||||
public:
|
||||
virtual void Begin();
|
||||
virtual void Commit();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include "SqlCtrl/init"
|
||||
#include "Oracle/init"
|
||||
#include "OleDB/init"
|
||||
#include "MySql/init"
|
||||
#include "plugin\sqlite3/init"
|
||||
#include "PostgreSQL/init"
|
||||
#include "MySql/init"
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue