Microsoft OLE DB access to Oracle Database
-
I have installed MDAC 2.5 on a development machine and am trying to use the OLE DB consumer templates to access an Oracle database. Oddly it seems that I also have to have installed the Oracle client in order to get this to work. Does anyone have an example of how open a datasource using the microsoft OLE DB provider. I'm using the following, but it will only work if the Oracle client is installed also HRESULT hr; CDataSource db; CDBPropSet dbinit(DBPROPSET_DBINIT); // dbinit.AddProperty(DBPROP_AUTH_PASSWORD, OLESTR("PASSWORD")); // dbinit.AddProperty(DBPROP_AUTH_USERID, OLESTR("USERID")); dbinit.AddProperty(DBPROP_INIT_DATASOURCE, OLESTR("DB_NAME")); // dbinit.AddProperty(DBPROP_INIT_LCID, (long)1033); dbinit.AddProperty(DBPROP_INIT_PROMPT, (short)DBPROMPT_COMPLETE); // dbinit.AddProperty(DBPROP_INIT_PROVIDERSTRING, OLESTR("")); // hr = db.Open(_T("OraOLEDB.Oracle.1"), &dbinit); hr = db.Open(_T("MSDAORA.1"), &dbinit); Any comments are welcome. Thanks. Chris
-
I have installed MDAC 2.5 on a development machine and am trying to use the OLE DB consumer templates to access an Oracle database. Oddly it seems that I also have to have installed the Oracle client in order to get this to work. Does anyone have an example of how open a datasource using the microsoft OLE DB provider. I'm using the following, but it will only work if the Oracle client is installed also HRESULT hr; CDataSource db; CDBPropSet dbinit(DBPROPSET_DBINIT); // dbinit.AddProperty(DBPROP_AUTH_PASSWORD, OLESTR("PASSWORD")); // dbinit.AddProperty(DBPROP_AUTH_USERID, OLESTR("USERID")); dbinit.AddProperty(DBPROP_INIT_DATASOURCE, OLESTR("DB_NAME")); // dbinit.AddProperty(DBPROP_INIT_LCID, (long)1033); dbinit.AddProperty(DBPROP_INIT_PROMPT, (short)DBPROMPT_COMPLETE); // dbinit.AddProperty(DBPROP_INIT_PROVIDERSTRING, OLESTR("")); // hr = db.Open(_T("OraOLEDB.Oracle.1"), &dbinit); hr = db.Open(_T("MSDAORA.1"), &dbinit); Any comments are welcome. Thanks. Chris
Sorry - MS OLEDB provider for Oracle requires Oracle client. From MDAC 2.5 documentation: "The Microsoft OLE DB Provider for Oracle requires a system running: Oracle client software (appropriately installed and configured) version 7.3.3.4.0 or later, or for Oracle8, version 8.0.4.1.1c" Tomasz Sowinski -- http://www.shooltz.com.pl
-
Sorry - MS OLEDB provider for Oracle requires Oracle client. From MDAC 2.5 documentation: "The Microsoft OLE DB Provider for Oracle requires a system running: Oracle client software (appropriately installed and configured) version 7.3.3.4.0 or later, or for Oracle8, version 8.0.4.1.1c" Tomasz Sowinski -- http://www.shooltz.com.pl
Thanks, Tomasz. I happened to miss that little gem. And it certainly helps answer a lot of questions. :) Chris