le info di identificazione sono presenti nel file "TNSNAMES.ORA"
ti allego la spiegazione,
Database Identification by Service Name
An Oracle database is represented to clients as a service, that is, the database performs work on behalf of clients. A database can have one or more services associated with it.
Up to Oracle8i, an Oracle database service was uniquely identified by an Oracle System Identifier (SID). The SID was also used internally by the database as pointer to the System Global Area (SGA). Clients connected to a database instance by specifying the SID in the connect descriptor. This naming scheme did not distinguish services from instances.
Because an Oracle database can span over multiple computers, both the service as a whole and each of its instances are specified in Oracle9i and Oracle8i.
Service Name
A database is now identified by its service name. The service name is specified by the SERVICE_NAMES parameter in the initialization parameter file. SERVICE_NAMES specifies the name of the highest-level view of Oracle database service, that may span instances and/or nodes. SERVICE_NAMES is defaulted to the global database name, a name comprised of the database name and domain name.
Instance Name
Database instances are identified by an instance name with the INSTANCE_NAME parameter in the initialization parameter file. INSTANCE_NAME corresponds to the SID of the instance.
Connect Descriptors
Configure connect descriptors with the SERVICE_NAME (without an S) parameter to connect to an Oracle9i or Oracle8i database. For example, the following connect descriptor contains the address of a listener located on sales1-sun listening for connection requests for a database service called sales.us.acme.com:
sales=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-sun1)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=sales.us.acme.com)))
Optionally, connect descriptors can be configured with the INSTANCE_NAME parameter to connect to a particular instance of the database. This may be necessary if you have an Oracle9i Real Application Clusters with multiple instances.
For example, the following connect descriptor contains the address of a listener located on sales-sun1 listening for connection requests for an instance called sales1 associated with the sales.us.acme.com database:
sales=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-sun1)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=sales.us.acme.com)
(INSTANCE_NAME=sales1)))
poi sul pc dovresti avere installato il driver per lavorare con oracle
ti faccio il paragone con php (solo per cercare di spiegarmi meglio) se vuoi accedere ad un db con php devi avere attivo il driver specifico
[ExtensionList]
extension=php_pdo_sqlsrv.dll
extension=php_sqlsrv.dll
;extension=php_mysql.dll
;extension=php_mysqli.dll
nel set dei dischi di installazione di oracle, io trovo "oracle database client" che ho installato sul pc
ho quindi trovato tutti i parametri per la gestione della connessione usando i file udl,
non uso la connessione che proponi tu, proprio perché nel file udl è presente anche il bottone "verifica della connessione" che assicura il funzionamento indipendentemente dal codice scritto
poi come detto uso il tutto come stai facendo tu
Codice:
Set myDB=CreateObject("ADODB.Connection")
myDB.ConnectionString="File Name=" & Opt_udlfile & ";"
SQLcmd="myDB.Open"
call SQLcmdExec(SQLcmd)
Set RS_tabelle = CreateObject("ADODB.Recordset")
imposto la query ...
call SQLcmdExec("RS_tabelle.Open")
Do While Not RS_tabelle.EOF
call Leggi_tabelle
sub SQLcmdExec(ActionToDo)
On Error Resume Next
Select Case ActionToDo
Case "RS_tabelle.Open" RS_tabelle.Open SQLcmd, myDB
Case "RS_tabelle.Close" RS_tabelle.Close
Case "myDB.Open" myDB.Open
Case "myDB.Close" myDB.Close
Case "EXEC" myDB.Execute(SQLcmd)
End Select
if Err.Number<>0 then
ErrMSG = "Error on : " & SQLcmd & vbCrLf & _
"Error Number : " & Err.Number & vbCrLf & _
"Description : " & Err.Description & vbCrLf2
LogFile.Write ErrMSG
if TRS then myDB.RollbackTrans
WScript.Quit(1)
end if
On Error Goto 0
End sub
se hai la possibilità, prova a creare il file udl sul server dove fisicamente è installato oracle, (non crea nessun problema)
così ti rendi conto del modo di agire