mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
*OleDB: fixed EnumPrimaryKey
git-svn-id: svn://ultimatepp.org/upp/trunk@3295 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
e70fbf1fbd
commit
4f7b93096b
2 changed files with 11 additions and 6 deletions
|
|
@ -1381,7 +1381,7 @@ Vector<String> OleDBSession::EnumSequences(String database)
|
|||
return out;
|
||||
}
|
||||
|
||||
Vector<String> OleDBSession::EnumPrimaryKeys(String database, String table)
|
||||
Vector<String> OleDBSession::EnumPrimaryKey(String database, String table)
|
||||
{
|
||||
Vector<String> out;
|
||||
IRef<IDBSchemaRowset> srowset;
|
||||
|
|
@ -1389,10 +1389,15 @@ Vector<String> OleDBSession::EnumPrimaryKeys(String database, String table)
|
|||
OleVariant restrictions[3];
|
||||
restrictions[0].vt = VT_BSTR;
|
||||
restrictions[0].bstrVal = StringToBSTR(database);
|
||||
restrictions[1].vt = VT_BSTR;
|
||||
restrictions[1].bstrVal = StringToBSTR(database);
|
||||
restrictions[2].vt = VT_BSTR;
|
||||
restrictions[2].bstrVal = StringToBSTR(table);
|
||||
Vector<String> parts = Split(table, '.');
|
||||
if(parts.GetCount() > 1) {
|
||||
restrictions[1].vt = VT_BSTR;
|
||||
restrictions[1].bstrVal = StringToBSTR(parts[0]);
|
||||
}
|
||||
if(!parts.IsEmpty()) {
|
||||
restrictions[2].vt = VT_BSTR;
|
||||
restrictions[2].bstrVal = StringToBSTR(parts.Top());
|
||||
}
|
||||
IRef<IRowset> trowset;
|
||||
OleVerify(srowset->GetRowset(NULL, DBSCHEMA_PRIMARY_KEYS, __countof(restrictions), restrictions,
|
||||
trowset.GetIID(), 0, NULL, trowset.SetUnk()));
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public:
|
|||
virtual Vector<String> EnumTables(String database);
|
||||
virtual Vector<String> EnumViews(String database);
|
||||
virtual Vector<String> EnumSequences(String database);
|
||||
virtual Vector<String> EnumPrimaryKeys(String database, String table);
|
||||
virtual Vector<String> EnumPrimaryKey(String database, String table);
|
||||
virtual String EnumRowID(String database, String table);
|
||||
|
||||
struct Provider
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue