Real Drums Destiny Ball Interest Calculator Torch 4 You The day of Safe Sex


 Powered by Max Banner Ads 

Connessione ad un server di Database Oracle con ASP e OLEDB

Mi è stato chiesto da un lettore un metodo valido per la connessione ad un DBMS Oracle tramite ASP, per cui posto il codice di esempio in queste pagine. Premetto che è necessario installare il Provider OLEDB di Oracle (quello di Microsoft ha diverse limitazioni).

Ecco il codice:

<%

Dim CN
Dim RS

Set CN = Server.CreateObject(”ADODB.Connection”)
Set RS = Server.CreateObject(”ADODB.Recordset”)

CN.Open “Provider=OraOLEDB.Oracle;Data Source=<TNSNAME>;User Id=<UTENTE>;Password=<PASSWORD>”

CN.cursorlocation = 3 ‘adUseClient
Set RS = CN.Execute(”SELECT * FROM Tabella1″)

nRighe = RS.RecordCount

RS.Close

CN.Close
Set CN = Nothing

%>

<%= nRighe %>

Ciao a tutti!

Technorati Tags: , , , , , , , , , , , , , , , , ,

1 Star2 Stars3 Stars4 Stars5 Stars (2 voti, punteggio medio: 5,00 su 5)
Loading ... Loading ...

Posted on settembre 25, 2008 by admin

Filed under Windows | | No Comments »



Leave a Reply