20#include <com/sun/star/sdbcx/Privilege.hpp>
21#include <com/sun/star/sdbcx/PrivilegeObject.hpp>
25#include <osl/diagnose.h>
26#include <systools/win32/oleauto.hxx>
27#include <com/sun/star/sdbc/DataType.hpp>
36#define MYADOID(l) {l, 0,0x10,{0x80,0,0,0xAA,0,0x6D,0x2E,0xA4}};
38const CLSID ADOS::CLSID_ADOCONNECTION_21 =
MYADOID(0x00000514);
39const IID ADOS::IID_ADOCONNECTION_21 =
MYADOID(0x00000550);
41const CLSID ADOS::CLSID_ADOCOMMAND_21 =
MYADOID(0x00000507);
42const IID ADOS::IID_ADOCOMMAND_21 =
MYADOID(0x0000054E);
44const CLSID ADOS::CLSID_ADORECORDSET_21 =
MYADOID(0x00000535);
45const IID ADOS::IID_ADORECORDSET_21 =
MYADOID(0x0000054F);
47const CLSID ADOS::CLSID_ADOCATALOG_25 =
MYADOID(0x00000602);
48const IID ADOS::IID_ADOCATALOG_25 =
MYADOID(0x00000603);
50const CLSID ADOS::CLSID_ADOINDEX_25 =
MYADOID(0x0000061E);
51const IID ADOS::IID_ADOINDEX_25 =
MYADOID(0x0000061F);
53const CLSID ADOS::CLSID_ADOTABLE_25 =
MYADOID(0x00000609);
54const IID ADOS::IID_ADOTABLE_25 =
MYADOID(0x00000610);
56const CLSID ADOS::CLSID_ADOKEY_25 =
MYADOID(0x00000621);
57const IID ADOS::IID_ADOKEY_25 =
MYADOID(0x00000622);
59const CLSID ADOS::CLSID_ADOCOLUMN_25 =
MYADOID(0x0000061B);
60const IID ADOS::IID_ADOCOLUMN_25 =
MYADOID(0x0000061C);
62const CLSID ADOS::CLSID_ADOGROUP_25 =
MYADOID(0x00000615);
63const IID ADOS::IID_ADOGROUP_25 =
MYADOID(0x00000616);
65const CLSID ADOS::CLSID_ADOUSER_25 =
MYADOID(0x00000618);
66const IID ADOS::IID_ADOUSER_25 =
MYADOID(0x00000619);
68const CLSID ADOS::CLSID_ADOVIEW_25 =
MYADOID(0x00000612);
69const IID ADOS::IID_ADOVIEW_25 =
MYADOID(0x00000613);
71sal::systools::BStr& ADOS::GetKeyStr()
73 static sal::systools::BStr sKeyStr(
u"gxwaezucfyqpwjgqbcmtsncuhwsnyhiohwxz");
80 sal_Int32
nType = DataType::VARCHAR;
83 case adUnsignedSmallInt:
84 case adSmallInt:
nType = DataType::SMALLINT;
break;
86 case adInteger:
nType = DataType::INTEGER;
break;
87 case adUnsignedBigInt:
88 case adBigInt:
nType = DataType::BIGINT;
break;
89 case adSingle:
nType = DataType::FLOAT;
break;
90 case adDouble:
nType = DataType::DOUBLE;
break;
91 case adCurrency:
nType = DataType::DOUBLE;
break;
93 case adNumeric:
nType = DataType::NUMERIC;
break;
94 case adDecimal:
nType = DataType::DECIMAL;
break;
95 case adDBDate:
nType = DataType::DATE;
break;
96 case adDBTime:
nType = DataType::TIME;
break;
98 case adDBTimeStamp:
nType = DataType::TIMESTAMP;
break;
99 case adBoolean:
nType = DataType::BOOLEAN;
break;
101 case adBinary:
nType = DataType::BINARY;
break;
102 case adGUID:
nType = DataType::OBJECT;
break;
106 case adVarChar:
nType = DataType::VARCHAR;
break;
108 case adLongVarChar:
nType = DataType::LONGVARCHAR;
break;
109 case adVarBinary:
nType = DataType::VARBINARY;
break;
110 case adLongVarBinary:
nType = DataType::LONGVARBINARY;
break;
111 case adChar:
nType = DataType::CHAR;
break;
112 case adUnsignedTinyInt:
113 case adTinyInt:
nType = DataType::TINYINT;
break;
114 case adEmpty:
nType = DataType::SQLNULL;
break;
123 nType = DataType::OTHER;
break;
125 OSL_FAIL(
"MapADOType2Jdbc: Unknown Type!");
135 case DataType::SMALLINT:
return adSmallInt;
break;
136 case DataType::INTEGER:
return adInteger;
break;
137 case DataType::BIGINT:
return adBigInt;
break;
138 case DataType::FLOAT:
return adSingle;
break;
139 case DataType::DOUBLE:
return adDouble;
break;
140 case DataType::NUMERIC:
return adNumeric;
break;
141 case DataType::DECIMAL:
return adDecimal;
break;
142 case DataType::DATE:
return isJetEngine(_nJetEngine) ? adDate : adDBDate;
break;
143 case DataType::TIME:
return adDBTime;
break;
144 case DataType::TIMESTAMP:
return isJetEngine(_nJetEngine) ? adDate : adDBTimeStamp;
break;
145 case DataType::BOOLEAN:
146 case DataType::BIT:
return adBoolean;
break;
147 case DataType::BINARY:
return adBinary;
break;
148 case DataType::VARCHAR:
return adVarWChar;
break;
150 case DataType::LONGVARCHAR:
return adLongVarWChar;
break;
151 case DataType::VARBINARY:
return adVarBinary;
break;
153 case DataType::LONGVARBINARY:
return adLongVarBinary;
break;
154 case DataType::CHAR:
return adWChar;
break;
155 case DataType::TINYINT:
return isJetEngine(_nJetEngine) ? adUnsignedTinyInt : adTinyInt;
break;
156 case DataType::OBJECT:
return adGUID;
break;
158 OSL_FAIL(
"MapJdbc2ADOType: Unknown Type!");
226 ObjectTypeEnum
eType = adPermObjTable;
229 case PrivilegeObject::TABLE:
230 eType = adPermObjTable;
232 case PrivilegeObject::VIEW:
233 eType = adPermObjView;
235 case PrivilegeObject::COLUMN:
236 eType = adPermObjColumn;
244 sal_Int32
nType = PrivilegeObject::TABLE;
248 nType = PrivilegeObject::TABLE;
251 nType = PrivilegeObject::VIEW;
253 case adPermObjColumn:
254 nType = PrivilegeObject::COLUMN;
257 OSL_FAIL(
"ADOS::mapAdoType2Object: privilege type cannot be translated!" );
268 sal_Int32 nRights = 0;
269 if((eRights & adRightInsert) == adRightInsert)
270 nRights |= Privilege::INSERT;
271 if((eRights & adRightDelete) == adRightDelete)
272 nRights |= css::sdbcx::Privilege::DELETE;
273 if((eRights & adRightUpdate) == adRightUpdate)
274 nRights |= Privilege::UPDATE;
275 if((eRights & adRightWriteDesign) == adRightWriteDesign)
276 nRights |= Privilege::ALTER;
277 if((eRights & adRightRead) == adRightRead)
278 nRights |= Privilege::SELECT;
279 if((eRights & adRightReference) == adRightReference)
280 nRights |= Privilege::REFERENCE;
281 if((eRights & adRightDrop) == adRightDrop)
282 nRights |= Privilege::DROP;
289 sal_Int32 eRights = adRightNone;
291 if((nRights & Privilege::INSERT) == Privilege::INSERT)
292 eRights |= adRightInsert;
293 if((nRights & Privilege::DELETE) == Privilege::DELETE)
294 eRights |= adRightDelete;
295 if((nRights & Privilege::UPDATE) == Privilege::UPDATE)
296 eRights |= adRightUpdate;
297 if((nRights & Privilege::ALTER) == Privilege::ALTER)
298 eRights |= adRightWriteDesign;
299 if((nRights & Privilege::SELECT) == Privilege::SELECT)
300 eRights |= adRightRead;
301 if((nRights & Privilege::REFERENCE) == Privilege::REFERENCE)
302 eRights |= adRightReference;
303 if((nRights & Privilege::DROP) == Privilege::DROP)
304 eRights |= adRightDrop;
315 _pRecordSet->get_Fields(&aFields);
316 if(_nColumnIndex <= 0 || _nColumnIndex > aFields.
GetItemCount())
const int JET_ENGINETYPE_EXCEL30
const int JET_ENGINETYPE_JET4X
const int JET_ENGINETYPE_LOTUSWK4
const int JET_ENGINETYPE_DBASE4
const int JET_ENGINETYPE_LOTUSWK1
const int JET_ENGINETYPE_LOTUSWK3
const int JET_ENGINETYPE_HTML1X
const int JET_ENGINETYPE_JET10
const int JET_ENGINETYPE_EXCEL40
const int JET_ENGINETYPE_PARADOX5X
const int JET_ENGINETYPE_DBASE3
const int JET_ENGINETYPE_JET3X
const int JET_ENGINETYPE_DBASE5
const int JET_ENGINETYPE_PARADOX7X
const int JET_ENGINETYPE_JET11
const int JET_ENGINETYPE_JET20
const int JET_ENGINETYPE_EXCHANGE4
const int JET_ENGINETYPE_EXCEL80
const int JET_ENGINETYPE_PARADOX4X
const int JET_ENGINETYPE_PARADOX3X
const int JET_ENGINETYPE_EXCEL90
const int JET_ENGINETYPE_EXCEL50
const int JET_ENGINETYPE_UNKNOWN
const int JET_ENGINETYPE_TEXT1X
static bool isJetEngine(sal_Int32 _nEngineType)
static ObjectTypeEnum mapObjectType2Ado(sal_Int32 objType)
static DataTypeEnum MapJdbc2ADOType(sal_Int32 _nType, sal_Int32 _nJetEngine)
static sal_Int32 MapADOType2Jdbc(DataTypeEnum eType)
static sal_Int32 mapRights2Ado(sal_Int32 nRights)
static WpADOField getField(ADORecordset *_pRecordSet, sal_Int32 _nColumnIndex)
static sal_Int32 mapAdoRights2Sdbc(RightsEnum eRights)
static sal_Int32 mapAdoType2Object(ObjectTypeEnum objType)
sal_Int32 GetItemCount() const
WrapT GetItem(sal_Int32 index) const