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


 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!

[tags]oracle, asp, ole, oledb, connection, recordset, adodb, aspx, net, codice, esempio, database, db, provider, space4tutorial, ilbloggatore, bloggatore, tutorial[/tags]

[ratings]

Posted on settembre 25, 2008 by admin

Filed under Windows | | No Comments »



Leave a Reply