1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef _CONNECTIVITY_ADO_AWRAPADO_HXX_
28*cdf0e10cSrcweir #define _CONNECTIVITY_ADO_AWRAPADO_HXX_
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp>
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir // Includes fuer ADO
33*cdf0e10cSrcweir #include "ado_pre_sys_include.h"
34*cdf0e10cSrcweir #include <oledb.h>
35*cdf0e10cSrcweir #include <ocidl.h>
36*cdf0e10cSrcweir #include <adoint.h>
37*cdf0e10cSrcweir #include "ado_post_sys_include.h"
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir #include "ado/adoimp.hxx"
41*cdf0e10cSrcweir #include "ado/Aolewrap.hxx"
42*cdf0e10cSrcweir #include "ado/Aolevariant.hxx"
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir namespace connectivity
45*cdf0e10cSrcweir {
46*cdf0e10cSrcweir 	namespace ado
47*cdf0e10cSrcweir 	{
48*cdf0e10cSrcweir 		class WpADOConnection;
49*cdf0e10cSrcweir 		class WpADOCommand;
50*cdf0e10cSrcweir 		class WpADORecordset;
51*cdf0e10cSrcweir 		class WpADOField;
52*cdf0e10cSrcweir 		class WpADOParameter;
53*cdf0e10cSrcweir 		class WpADOError;
54*cdf0e10cSrcweir 		class WpADOProperty;
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir 		typedef WpOLEAppendCollection<	ADOFields,		ADOField,		WpADOField>			WpADOFields;
57*cdf0e10cSrcweir 		typedef WpOLECollection<		ADOProperties,	ADOProperty,	WpADOProperty>		WpADOProperties;
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir 		//------------------------------------------------------------------------
60*cdf0e10cSrcweir 		class WpADOConnection : public WpOLEBase<ADOConnection>
61*cdf0e10cSrcweir 		{
62*cdf0e10cSrcweir 			friend class WpADOCommand;
63*cdf0e10cSrcweir 		public:
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir 			WpADOConnection(ADOConnection* pInt)	:	WpOLEBase<ADOConnection>(pInt){}
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir 			WpADOConnection(const WpADOConnection& rhs){operator=(rhs);}
68*cdf0e10cSrcweir 
69*cdf0e10cSrcweir 			 WpADOConnection& operator=(const WpADOConnection& rhs)
70*cdf0e10cSrcweir 				{WpOLEBase<ADOConnection>::operator=(rhs); return *this;}
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir 			//////////////////////////////////////////////////////////////////////
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir 			WpADOProperties get_Properties() const;
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir 			 rtl::OUString GetConnectionString() const;
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir 			 sal_Bool PutConnectionString(const ::rtl::OUString &aCon) const;
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir 			 sal_Int32 GetCommandTimeout() const;
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir 			 void PutCommandTimeout(sal_Int32 nRet);
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir 			 sal_Int32 GetConnectionTimeout() const	;
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir 			 void PutConnectionTimeout(sal_Int32 nRet);
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir 			 sal_Bool Close( ) ;
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir 			 sal_Bool Execute(const ::rtl::OUString& _CommandText,OLEVariant& RecordsAffected,long Options, WpADORecordset** ppiRset);
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir 			 sal_Bool BeginTrans();
93*cdf0e10cSrcweir 
94*cdf0e10cSrcweir 			 sal_Bool CommitTrans( ) ;
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir 			 sal_Bool RollbackTrans( );
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir 			 sal_Bool Open(const ::rtl::OUString& ConnectionString, const ::rtl::OUString& UserID,const ::rtl::OUString& Password,long Options);
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir 			 sal_Bool GetErrors(ADOErrors** pErrors);
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir 			 ::rtl::OUString GetDefaultDatabase() const;
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir 			 sal_Bool PutDefaultDatabase(const ::rtl::OUString& _bstr);
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir 			 IsolationLevelEnum get_IsolationLevel() const ;
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir 			 sal_Bool put_IsolationLevel(const IsolationLevelEnum& eNum) ;
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir 			 sal_Int32 get_Attributes() const;
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir 			 sal_Bool put_Attributes(sal_Int32 nRet);
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir 			 CursorLocationEnum get_CursorLocation() const;
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir 			 sal_Bool put_CursorLocation(const CursorLocationEnum &eNum) ;
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir 			 ConnectModeEnum get_Mode() const;
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir 			 sal_Bool put_Mode(const ConnectModeEnum &eNum) ;
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir 			 ::rtl::OUString get_Provider() const;
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir 			 sal_Bool put_Provider(const ::rtl::OUString& _bstr);
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir 			 sal_Int32 get_State() const;
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir 			 sal_Bool OpenSchema(SchemaEnum eNum,OLEVariant& Restrictions,OLEVariant& SchemaID,ADORecordset**pprset);
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir 			 ::rtl::OUString get_Version() const;
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir 			 // special methods
133*cdf0e10cSrcweir 			 ADORecordset* getExportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table );
134*cdf0e10cSrcweir 			 ADORecordset* getImportedKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table );
135*cdf0e10cSrcweir 			 ADORecordset* getPrimaryKeys( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table );
136*cdf0e10cSrcweir 			 ADORecordset* getIndexInfo( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Bool unique, sal_Bool approximate );
137*cdf0e10cSrcweir 			 ADORecordset* getTablePrivileges( const ::com::sun::star::uno::Any& catalog,
138*cdf0e10cSrcweir 												  const ::rtl::OUString& schemaPattern,
139*cdf0e10cSrcweir 												  const ::rtl::OUString& tableNamePattern );
140*cdf0e10cSrcweir 			 ADORecordset* getCrossReference( const ::com::sun::star::uno::Any& primaryCatalog,
141*cdf0e10cSrcweir 												  const ::rtl::OUString& primarySchema,
142*cdf0e10cSrcweir 												  const ::rtl::OUString& primaryTable,
143*cdf0e10cSrcweir 												  const ::com::sun::star::uno::Any& foreignCatalog,
144*cdf0e10cSrcweir 												  const ::rtl::OUString& foreignSchema,
145*cdf0e10cSrcweir 												  const ::rtl::OUString& foreignTable);
146*cdf0e10cSrcweir 			 ADORecordset* getProcedures( const ::com::sun::star::uno::Any& catalog,
147*cdf0e10cSrcweir 												  const ::rtl::OUString& schemaPattern,
148*cdf0e10cSrcweir 												  const ::rtl::OUString& procedureNamePattern );
149*cdf0e10cSrcweir 			 ADORecordset* getProcedureColumns( const ::com::sun::star::uno::Any& catalog,
150*cdf0e10cSrcweir 												  const ::rtl::OUString& schemaPattern,
151*cdf0e10cSrcweir 												  const ::rtl::OUString& procedureNamePattern,
152*cdf0e10cSrcweir 												  const ::rtl::OUString& columnNamePattern );
153*cdf0e10cSrcweir 			 ADORecordset* getTables( const ::com::sun::star::uno::Any& catalog,
154*cdf0e10cSrcweir 												  const ::rtl::OUString& schemaPattern,
155*cdf0e10cSrcweir 												  const ::rtl::OUString& tableNamePattern,
156*cdf0e10cSrcweir 												  const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types );
157*cdf0e10cSrcweir 			 ADORecordset* getColumns( const ::com::sun::star::uno::Any& catalog,
158*cdf0e10cSrcweir 												  const ::rtl::OUString& schemaPattern,
159*cdf0e10cSrcweir 												  const ::rtl::OUString& tableNamePattern,
160*cdf0e10cSrcweir 												  const ::rtl::OUString& columnNamePattern );
161*cdf0e10cSrcweir 			 ADORecordset* getColumnPrivileges( const ::com::sun::star::uno::Any& catalog,
162*cdf0e10cSrcweir 												  const ::rtl::OUString& schemaPattern,
163*cdf0e10cSrcweir 												  const ::rtl::OUString& table,
164*cdf0e10cSrcweir 												  const ::rtl::OUString& columnNamePattern );
165*cdf0e10cSrcweir 			 ADORecordset* getTypeInfo(DataTypeEnum _eType = adEmpty );
166*cdf0e10cSrcweir 		};
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir 		//------------------------------------------------------------------------
169*cdf0e10cSrcweir 		class WpADOCommand : public WpOLEBase<ADOCommand>
170*cdf0e10cSrcweir 		{
171*cdf0e10cSrcweir 		public:
172*cdf0e10cSrcweir 			WpADOCommand(){}
173*cdf0e10cSrcweir 			// Konstruktoren, operator=
174*cdf0e10cSrcweir 			// diese rufen nur die Oberklasse
175*cdf0e10cSrcweir 			WpADOCommand(ADOCommand* pInt)	:	WpOLEBase<ADOCommand>(pInt){}
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir 			WpADOCommand(const WpADOCommand& rhs){operator=(rhs);}
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir 			 WpADOCommand& operator=(const WpADOCommand& rhs)
180*cdf0e10cSrcweir 			{
181*cdf0e10cSrcweir 				WpOLEBase<ADOCommand>::operator=(rhs); return *this;}
182*cdf0e10cSrcweir 
183*cdf0e10cSrcweir 			//////////////////////////////////////////////////////////////////////
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir 			sal_Bool putref_ActiveConnection( WpADOConnection *pCon);
186*cdf0e10cSrcweir 
187*cdf0e10cSrcweir 			void put_ActiveConnection(/* [in] */ const OLEVariant& vConn);
188*cdf0e10cSrcweir 			 void Create();
189*cdf0e10cSrcweir 			 sal_Int32 get_State() const;
190*cdf0e10cSrcweir 			 ::rtl::OUString get_CommandText() const;
191*cdf0e10cSrcweir 			 sal_Bool put_CommandText(const ::rtl::OUString &aCon) ;
192*cdf0e10cSrcweir 			 sal_Int32 get_CommandTimeout() const;
193*cdf0e10cSrcweir 			 void put_CommandTimeout(sal_Int32 nRet);
194*cdf0e10cSrcweir 			 sal_Bool get_Prepared() const;
195*cdf0e10cSrcweir 			 sal_Bool put_Prepared(VARIANT_BOOL bPrepared) const;
196*cdf0e10cSrcweir 			 sal_Bool Execute(OLEVariant& RecordsAffected,OLEVariant& Parameters,long Options, ADORecordset** ppiRset);
197*cdf0e10cSrcweir 			 ADOParameter* CreateParameter(const ::rtl::OUString &_bstr,DataTypeEnum Type,ParameterDirectionEnum Direction,long nSize,const OLEVariant &Value);
198*cdf0e10cSrcweir 
199*cdf0e10cSrcweir 			 ADOParameters* get_Parameters() const;
200*cdf0e10cSrcweir 			 sal_Bool put_CommandType( /* [in] */ CommandTypeEnum lCmdType);
201*cdf0e10cSrcweir 			 CommandTypeEnum get_CommandType( ) const ;
202*cdf0e10cSrcweir 			// gibt den Namen des Feldes zur"ueck
203*cdf0e10cSrcweir 			 ::rtl::OUString GetName() const ;
204*cdf0e10cSrcweir 			 sal_Bool put_Name(const ::rtl::OUString& _Name);
205*cdf0e10cSrcweir 			 sal_Bool Cancel();
206*cdf0e10cSrcweir 		};
207*cdf0e10cSrcweir 		//------------------------------------------------------------------------
208*cdf0e10cSrcweir 		class WpADOError : public WpOLEBase<ADOError>
209*cdf0e10cSrcweir 		{
210*cdf0e10cSrcweir 		public:
211*cdf0e10cSrcweir 
212*cdf0e10cSrcweir 			// Konstruktoren, operator=
213*cdf0e10cSrcweir 			// diese rufen nur die Oberklasse
214*cdf0e10cSrcweir 
215*cdf0e10cSrcweir 			WpADOError(ADOError* pInt):WpOLEBase<ADOError>(pInt){}
216*cdf0e10cSrcweir 
217*cdf0e10cSrcweir 			WpADOError(const WpADOError& rhs){operator=(rhs);}
218*cdf0e10cSrcweir 
219*cdf0e10cSrcweir 			 WpADOError& operator=(const WpADOError& rhs)
220*cdf0e10cSrcweir 				{WpOLEBase<ADOError>::operator=(rhs); return *this;}
221*cdf0e10cSrcweir 
222*cdf0e10cSrcweir 			//////////////////////////////////////////////////////////////////////
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir 			 ::rtl::OUString GetDescription() const;
225*cdf0e10cSrcweir 
226*cdf0e10cSrcweir 			 ::rtl::OUString GetSource() const ;
227*cdf0e10cSrcweir 
228*cdf0e10cSrcweir 			 sal_Int32 GetNumber() const ;
229*cdf0e10cSrcweir 			 ::rtl::OUString GetSQLState() const ;
230*cdf0e10cSrcweir 			 sal_Int32 GetNativeError() const ;
231*cdf0e10cSrcweir 		};
232*cdf0e10cSrcweir 
233*cdf0e10cSrcweir 
234*cdf0e10cSrcweir 
235*cdf0e10cSrcweir 		//------------------------------------------------------------------------
236*cdf0e10cSrcweir 		class WpADOField : public WpOLEBase<ADOField>
237*cdf0e10cSrcweir 		{
238*cdf0e10cSrcweir 			//	friend class WpADOFields;
239*cdf0e10cSrcweir 		public:
240*cdf0e10cSrcweir 
241*cdf0e10cSrcweir 			// Konstruktoren, operator=
242*cdf0e10cSrcweir 			// diese rufen nur die Oberklasse
243*cdf0e10cSrcweir 			WpADOField(ADOField* pInt=NULL):WpOLEBase<ADOField>(pInt){}
244*cdf0e10cSrcweir 			WpADOField(const WpADOField& rhs){operator=(rhs);}
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir 			 WpADOField& operator=(const WpADOField& rhs)
247*cdf0e10cSrcweir 				{WpOLEBase<ADOField>::operator=(rhs); return *this;}
248*cdf0e10cSrcweir 			//////////////////////////////////////////////////////////////////////
249*cdf0e10cSrcweir 
250*cdf0e10cSrcweir 			 WpADOProperties get_Properties();
251*cdf0e10cSrcweir 			 sal_Int32 GetActualSize() const ;
252*cdf0e10cSrcweir 			 sal_Int32 GetAttributes() const ;
253*cdf0e10cSrcweir 			 sal_Int32 GetStatus() const 	  ;
254*cdf0e10cSrcweir 			 sal_Int32 GetDefinedSize() const ;
255*cdf0e10cSrcweir 			// gibt den Namen des Feldes zur"ueck
256*cdf0e10cSrcweir 			 ::rtl::OUString GetName() const ;
257*cdf0e10cSrcweir 			 DataTypeEnum GetADOType() const  ;
258*cdf0e10cSrcweir 			 void get_Value(OLEVariant& aValVar) const ;
259*cdf0e10cSrcweir 			 OLEVariant get_Value() const;
260*cdf0e10cSrcweir 			 sal_Bool PutValue(const OLEVariant& aVariant);
261*cdf0e10cSrcweir 			 sal_Int32 GetPrecision() const ;
262*cdf0e10cSrcweir 			 sal_Int32 GetNumericScale() const ;
263*cdf0e10cSrcweir 			 sal_Bool AppendChunk(const OLEVariant& _Variant);
264*cdf0e10cSrcweir 			 OLEVariant GetChunk(long Length) const;
265*cdf0e10cSrcweir 			 void GetChunk(long Length,OLEVariant &aValVar) const;
266*cdf0e10cSrcweir 			 OLEVariant GetOriginalValue() const;
267*cdf0e10cSrcweir 			 void GetOriginalValue(OLEVariant &aValVar) const;
268*cdf0e10cSrcweir 			 OLEVariant GetUnderlyingValue() const;
269*cdf0e10cSrcweir 
270*cdf0e10cSrcweir 			 void GetUnderlyingValue(OLEVariant &aValVar) const;
271*cdf0e10cSrcweir 
272*cdf0e10cSrcweir 			 sal_Bool PutPrecision(sal_Int8 _prec);
273*cdf0e10cSrcweir 
274*cdf0e10cSrcweir 			 sal_Bool PutNumericScale(sal_Int8 _prec);
275*cdf0e10cSrcweir 
276*cdf0e10cSrcweir 			 void PutADOType(DataTypeEnum eType) ;
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir 			 sal_Bool PutDefinedSize(sal_Int32 _nDefSize);
279*cdf0e10cSrcweir 
280*cdf0e10cSrcweir 			 sal_Bool PutAttributes(sal_Int32 _nDefSize);
281*cdf0e10cSrcweir 		};
282*cdf0e10cSrcweir 
283*cdf0e10cSrcweir 
284*cdf0e10cSrcweir 
285*cdf0e10cSrcweir 		//------------------------------------------------------------------------
286*cdf0e10cSrcweir 		class WpADOProperty: public WpOLEBase<ADOProperty>
287*cdf0e10cSrcweir 		{
288*cdf0e10cSrcweir 		public:
289*cdf0e10cSrcweir 			// Konstruktoren, operator=
290*cdf0e10cSrcweir 			// diese rufen nur die Oberklasse
291*cdf0e10cSrcweir 			WpADOProperty(ADOProperty* pInt=NULL):WpOLEBase<ADOProperty>(pInt){}
292*cdf0e10cSrcweir 			WpADOProperty(const WpADOProperty& rhs){operator=(rhs);}
293*cdf0e10cSrcweir 			 WpADOProperty& operator=(const WpADOProperty& rhs)
294*cdf0e10cSrcweir 				{WpOLEBase<ADOProperty>::operator=(rhs); return *this;}
295*cdf0e10cSrcweir 			//////////////////////////////////////////////////////////////////////
296*cdf0e10cSrcweir 
297*cdf0e10cSrcweir 			 OLEVariant GetValue() const;
298*cdf0e10cSrcweir 			 void GetValue(OLEVariant &aValVar) const;
299*cdf0e10cSrcweir 			 sal_Bool PutValue(const OLEVariant &aValVar) ;
300*cdf0e10cSrcweir 			 ::rtl::OUString GetName() const ;
301*cdf0e10cSrcweir 			 DataTypeEnum GetADOType() const ;
302*cdf0e10cSrcweir 			 sal_Int32 GetAttributes() const ;
303*cdf0e10cSrcweir 			 sal_Bool PutAttributes(sal_Int32 _nDefSize);
304*cdf0e10cSrcweir 		};
305*cdf0e10cSrcweir 
306*cdf0e10cSrcweir 
307*cdf0e10cSrcweir 		class WpADORecordset : public WpOLEBase<ADORecordset>
308*cdf0e10cSrcweir 		{
309*cdf0e10cSrcweir 
310*cdf0e10cSrcweir 		public:
311*cdf0e10cSrcweir 			// Konstruktoren, operator=
312*cdf0e10cSrcweir 			// diese rufen nur die Oberklasse
313*cdf0e10cSrcweir 			WpADORecordset(ADORecordset* pInt=NULL):WpOLEBase<ADORecordset>(pInt){}
314*cdf0e10cSrcweir 			WpADORecordset(const WpADORecordset& rhs){operator=(rhs);}
315*cdf0e10cSrcweir 			 WpADORecordset& operator=(const WpADORecordset& rhs)
316*cdf0e10cSrcweir 			{
317*cdf0e10cSrcweir 				WpOLEBase<ADORecordset>::operator=(rhs);
318*cdf0e10cSrcweir 				return *this;
319*cdf0e10cSrcweir 			}
320*cdf0e10cSrcweir 			~WpADORecordset()
321*cdf0e10cSrcweir 			{
322*cdf0e10cSrcweir 				//	if(pInterface && get_State() == adStateOpen)
323*cdf0e10cSrcweir 					//	Close();
324*cdf0e10cSrcweir 			}
325*cdf0e10cSrcweir 			//////////////////////////////////////////////////////////////////////
326*cdf0e10cSrcweir 			 void Create();
327*cdf0e10cSrcweir 			 sal_Bool Open(
328*cdf0e10cSrcweir 					/* [optional][in] */ VARIANT Source,
329*cdf0e10cSrcweir 					/* [optional][in] */ VARIANT ActiveConnection,
330*cdf0e10cSrcweir 					/* [defaultvalue][in] */ CursorTypeEnum CursorType,
331*cdf0e10cSrcweir 					/* [defaultvalue][in] */ LockTypeEnum LockType,
332*cdf0e10cSrcweir 					/* [defaultvalue][in] */ sal_Int32 Options);
333*cdf0e10cSrcweir 			 LockTypeEnum GetLockType();
334*cdf0e10cSrcweir 			 void Close();
335*cdf0e10cSrcweir 			 sal_Bool Cancel() const;
336*cdf0e10cSrcweir 			 sal_Int32 get_State( );
337*cdf0e10cSrcweir 			 sal_Bool Supports( /* [in] */ CursorOptionEnum CursorOptions);
338*cdf0e10cSrcweir 			PositionEnum get_AbsolutePosition();
339*cdf0e10cSrcweir 			 void GetDataSource(IUnknown** pIUnknown) const ;
340*cdf0e10cSrcweir 			 void PutRefDataSource(IUnknown* pIUnknown);
341*cdf0e10cSrcweir 			 void GetBookmark(VARIANT& var);
342*cdf0e10cSrcweir 			 OLEVariant GetBookmark();
343*cdf0e10cSrcweir 			CompareEnum CompareBookmarks(const OLEVariant& left,const OLEVariant& right);
344*cdf0e10cSrcweir 			 sal_Bool SetBookmark(const OLEVariant &pSafeAr);
345*cdf0e10cSrcweir 			 WpADOFields GetFields() const;
346*cdf0e10cSrcweir 			 sal_Bool Move(sal_Int32 nRows, VARIANT aBmk);
347*cdf0e10cSrcweir 			 sal_Bool MoveNext();
348*cdf0e10cSrcweir 			 sal_Bool MovePrevious();
349*cdf0e10cSrcweir 			 sal_Bool MoveFirst();
350*cdf0e10cSrcweir 			 sal_Bool MoveLast();
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir 			 sal_Bool IsAtBOF() const;
353*cdf0e10cSrcweir 			 sal_Bool IsAtEOF() const;
354*cdf0e10cSrcweir 			 sal_Bool Delete(AffectEnum eNum);
355*cdf0e10cSrcweir 			 sal_Bool AddNew(const OLEVariant &FieldList,const OLEVariant &Values);
356*cdf0e10cSrcweir 			 sal_Bool Update(const OLEVariant &FieldList,const OLEVariant &Values);
357*cdf0e10cSrcweir 			 sal_Bool CancelUpdate();
358*cdf0e10cSrcweir 			 WpADOProperties get_Properties() const;
359*cdf0e10cSrcweir 			 sal_Bool NextRecordset(OLEVariant& RecordsAffected,ADORecordset** ppiRset);
360*cdf0e10cSrcweir 			 sal_Bool get_RecordCount(sal_Int32 &_nRet) const;
361*cdf0e10cSrcweir 			 sal_Bool get_MaxRecords(sal_Int32 &_nRet) const;
362*cdf0e10cSrcweir 			 sal_Bool put_MaxRecords(sal_Int32 _nRet);
363*cdf0e10cSrcweir 			 sal_Bool get_CursorType(CursorTypeEnum &_nRet) const;
364*cdf0e10cSrcweir 			 sal_Bool put_CursorType(CursorTypeEnum _nRet);
365*cdf0e10cSrcweir 			 sal_Bool get_LockType(LockTypeEnum &_nRet) const;
366*cdf0e10cSrcweir 			 sal_Bool put_LockType(LockTypeEnum _nRet);
367*cdf0e10cSrcweir 			 sal_Bool get_CacheSize(sal_Int32 &_nRet) const;
368*cdf0e10cSrcweir 			 sal_Bool put_CacheSize(sal_Int32 _nRet);
369*cdf0e10cSrcweir 			 sal_Bool UpdateBatch(AffectEnum AffectRecords);
370*cdf0e10cSrcweir 		};
371*cdf0e10cSrcweir 
372*cdf0e10cSrcweir 		//------------------------------------------------------------------------
373*cdf0e10cSrcweir 		class WpADOParameter:public WpOLEBase<ADOParameter>
374*cdf0e10cSrcweir 		{
375*cdf0e10cSrcweir 		public:
376*cdf0e10cSrcweir 			// Konstruktoren, operator=
377*cdf0e10cSrcweir 			// diese rufen nur die Oberklasse
378*cdf0e10cSrcweir 			WpADOParameter(ADOParameter* pInt):WpOLEBase<ADOParameter>(pInt){}
379*cdf0e10cSrcweir 			WpADOParameter(const WpADOParameter& rhs):WpOLEBase<ADOParameter>(rhs){}
380*cdf0e10cSrcweir 			 WpADOParameter& operator=(const WpADOParameter& rhs)
381*cdf0e10cSrcweir 				{WpOLEBase<ADOParameter>::operator=(rhs); return *this;}
382*cdf0e10cSrcweir 			//////////////////////////////////////////////////////////////////////
383*cdf0e10cSrcweir 
384*cdf0e10cSrcweir 			 ::rtl::OUString GetName() const ;
385*cdf0e10cSrcweir 			 DataTypeEnum GetADOType() const ;
386*cdf0e10cSrcweir 			 void put_Type(const DataTypeEnum& _eType);
387*cdf0e10cSrcweir 			 sal_Bool put_Size(const sal_Int32& _nSize);
388*cdf0e10cSrcweir 			 sal_Int32 GetAttributes() const ;
389*cdf0e10cSrcweir 			 sal_Int32 GetPrecision() const ;
390*cdf0e10cSrcweir 			 sal_Int32 GetNumericScale() const ;
391*cdf0e10cSrcweir 			 ParameterDirectionEnum get_Direction() const;
392*cdf0e10cSrcweir 			 void GetValue(OLEVariant& aValVar) const ;
393*cdf0e10cSrcweir 			 OLEVariant GetValue() const;
394*cdf0e10cSrcweir 			 sal_Bool PutValue(const OLEVariant& aVariant);
395*cdf0e10cSrcweir 			 sal_Bool AppendChunk(const OLEVariant& aVariant);
396*cdf0e10cSrcweir 		};
397*cdf0e10cSrcweir 
398*cdf0e10cSrcweir 		class OTools
399*cdf0e10cSrcweir 		{
400*cdf0e10cSrcweir 		public:
401*cdf0e10cSrcweir 			/** putValue set the property value at the ado column
402*cdf0e10cSrcweir 				@param	_rProps		the properties where to set
403*cdf0e10cSrcweir 				@param	_aPosition	which property to set
404*cdf0e10cSrcweir 				@param	_aValVar	the value to set
405*cdf0e10cSrcweir 			*/
406*cdf0e10cSrcweir 			static void				putValue(const WpADOProperties& _rProps,const OLEVariant &_aPosition,const OLEVariant &_aValVar);
407*cdf0e10cSrcweir 
408*cdf0e10cSrcweir 			/** getValue returns a specific property value
409*cdf0e10cSrcweir 				@param	_rProps		the properties where to set
410*cdf0e10cSrcweir 				@param	_aPosition	the property
411*cdf0e10cSrcweir 
412*cdf0e10cSrcweir 				@return	the property value
413*cdf0e10cSrcweir 			*/
414*cdf0e10cSrcweir 			static OLEVariant		getValue(const WpADOProperties& _rProps,const OLEVariant &_aPosition);
415*cdf0e10cSrcweir 		};
416*cdf0e10cSrcweir 	}
417*cdf0e10cSrcweir }
418*cdf0e10cSrcweir #endif //_CONNECTIVITY_ADO_AWRAPADO_HXX_
419*cdf0e10cSrcweir 
420