Hola,
Alguien me puede decir la mínima instalacion en la maquina cliente para poder conectar a Oracle 11g via ADO ? Existe algun mini-pack, mini-instalacion, mini registro de dll, ... para no tener que instalar todo el kit.
Gracias !
//----------------------------------------------------------//
//cConnStr := "Provider=MSDAORA.1;Password=****;User ID=apps;Data Source=PROD;Persist Security Info=True" // Usuando Cliente Microsoft y TNSNAMES.ORA necesita cliente instalado
//cConnStr := "Provider=MSDAORA.1;Password=****;User ID=apps;Data Source=ERPNET;Persist Security Info=True" // Cliente de Microsoft y Usando DSN necesita cliente instalado y TNSNAMES.ORA
//cConnStr := "Provider=OraOLEDB.Oracle;Data Source=192.168.X.YYY:15XX/PROD;User ID=apps;Password=*****;" Conexion Directa necesita Cliente de Oracle
//cConnStr := 'Provider=OraOLEDB.Oracle;Data Source=ERPNET;User ID=***;Password=apps;' // Conexion con cliente de Oracle y DSN
//cConnStr := "Provider=OraOLEDB.Oracle;Data Source=192.168.X.YYY:15XX/XE;Initial Catalog=PROD;User Id=apps;Password=****;" // Conexion Directa
//cConnStr := 'Provider=MSDAORA.1;Data Source=PROD;User ID=apps;Password=****' // Conexion con CLiente de Microsoft y TNSNAMES.ORA
//cConnStr := "Provider=OraOLEDB.Oracle;Data Source=PROD;User Id=apps;Password=apps;OLEDB.NET=True;" // Cliente de ORacle y TNSNAMES.ORA
//cConnStr := "Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.X.YYY)(PORT=15XX)))(CONNECT_DATA=(SID=PROD)(SERVER=DEDICATED)));User Id=apps;Password=****;" // Creando el TNSNAMES en linea
//cConnStr := "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.X.YYY)(PORT=15XX))(CONNECT_DATA=(SERVICE_NAME=PROD)));User Id=apps;Password=apps;" // Creando el TNSNAMES en linea
// cConnStr := 'Provider=MSDAORA.1;Data Source=PROD;User ID=apps;Password=apps'
cConnStr := 'Provider=OraOLEDB.Oracle;Data Source=PRODU;User ID=apps;Password=apps'
oCn := FW_OpenAdoConnection( cCmd )
cSql := "Select * from po_vendors"
oRs := Fw_Openrecordset(oCn,cSql)
Xbrowse( oRs )
#include "ado.ch"
//----------------------------------------------------------------------------//
function FW_OpenAdoConnection( cConnStr )
local oCn
oCn := TOleAuto():New( "ADODB.Connection" )
oCn:ConnectionString := cConnStr
oCn:CursorLocation := 3 // adUseClient
TRY
oCn:Open()
CATCH
oCn := nil
END
return oCn
//----------------------------------------------------------------------------//
function FW_OpenRecordSet( oCn, cSql, nLockType )
local oRs
DEFAULT nLockType := 3 // adLockOptimistic
oRs := TOleAuto():new( "ADODB.RecordSet" )
TRY
WITH OBJECT oRs
:ActiveConnection := oCn
:Source := cSql
:LockType := nLockType
:CursorLocation := 3 // adUseClient
:CacheSize := 100
END
oRs:Open()
CATCH
//ShowAdoError( oRs:ActiveConnection )
oRs := nil
END
return oRs
//--------------------------------------------------//
Static function ShowAdoError( oCon )
local oErr, nErr, cErr
nErr := oCon:Errors:Count()
if nErr > 0
oErr := oCon:Errors[ nErr - 1 ]
cErr := oErr:Description
// cErr += CRLF + "Code : " + cValToChar( oErr:NativeError )
// cErr := "Description : " + oErr:Description
// cErr += CRLF + "SubCode : " + cValToChar( oErr:NativeError )
// cErr += CRLF + "Source : " + oErr:Source
MsgInfo( cErr,oErr:Source+' Error' )
else
MsgInfo( 'Error inesperado contacte al Administrador del Sistema' )
endif
return nil
//----------------------------------------------------------//
# TNSNAMES.ORA Network Configuration File: c:\Ora9i\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
xPROVIDER := "OraOledb.oracle"
xSOURCE := "YourDatabase"
xUSERID := "YourUserId"
xPASSWORD := "YourPassword"
xConnect := 'Provider='+xPROVIDER+';Data Source='+xSOURCE+';User Id='+xUSERID+';Password='+xPASSWORD
cSql := "Select * From [YourTable]"
oRs := TOleAuto():New( "ADODB.Recordset" )
oRs:CursorType := 1 // opendkeyset
oRs:CursorLocation := 3 // local cache
oRs:LockType := 3 // lockoportunistic
TRY
oRs:Open(cSQL,xConnect )
CATCH oErr
MsgInfo( "Error in Opening table" )
RETURN(.F.)
END TRY
IF oRs:EOF
SAYING := "Could not find any matching records"
MsgInfo( SAYING )
RETURN(.F.)
ENDIF
cConnStr := "Provider=OraOLEDB.Oracle;Data Source=192.168.X.YYY:15XX/SID;User ID=apps;Password=*****;"
OraOLEDBplus11.dll : No se puede encontrar el modulo especificado
REGSVR32 OraOLEDBpus11.dll
This is what I have found that works...
For a 64-bit Oracle client install on Sql Download and install the ODAC Oracle client driver for 64 bit systems. Create the environment Variable for “TNS_Admin” and for the value use the path to where the tnsnames.ora file is at. For example “C:\app\product\11.2.0\client_1”
Also, in the Variable “Path”, include the directory where the Oracle\bin folder is located. For example…
“C:\app\product\11.2.0\client_1\bin”. If you miss this part, you will get an error saying the OraOLEDBpus11.dll could not be found.
To test…
Create a text file on your desktop called “Test.udl”. Double click on the file and it should open the “Data Link Properties”, move to the “Provider” tab and then select “Oracle Provider for OLE DB” and then next. Enter your connection properties and test.
Hope this is some help to someone that might be trying to do this in the future too.
Brian
Also, if your doing this for “Linked Servers” inside of SQL Server, don’t forget to go the Providers folder under the Linked Servers and open up the properties for “OraOLEDB.Oracle” and check the box “Allow inprocess”
In the case of a 32-bit SQL installation… Install Oracle client drivers….
What a mess, but this is what you need to do…
I did a custom install, installing the Oracle client driver Oracle .Net, and the ODBC and OLE drivers.After the install, you need to open regedit… find the key “Oracle\Inventory”. Change the path from “C:\Program Files(x86)\Oracle\Inventory” to “C:\Program Files\Oracle\Inventory” Then do a cut and paste of the Oracle directory from ““C:\Program Files(x86)\” and paste to ““C:\Program Files\”.
Then from “C:\Windows\SysWOW64\” run the application “odbcad32.exe”. This is where the drivers will be located at.
REGSVR32 OraOLEDBpus11.dll
regsvr32 /s C:\oracle\product\11.2.0\client_1\BIN\OraOLEDB11.dll
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 49 guests