Microsoft KB Archive/193225

= How to connect to an Oracle database by using ASP and ADO =

Article ID: 193225

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Active Server Pages 4.0
 * Microsoft Internet Information Services 6.0
 * Microsoft Data Access Components 2.8

-



This article was previously published under Q193225



INTRODUCTION
This article discusses how to connect to an Oracle database by using a Microsoft Active Server Pages (ASP) page and Microsoft ActiveX Data Objects (ADO).



MORE INFORMATION
To connect to an Oracle database, you can create an ASP page that contains the following code.

Note Make sure that the connect string has a valid user ID and password and that the SQL statement references a valid table. <%@ Language=VBScript %> Oracle Test <%    Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open "Provider=MSDAORA;Data Source=;User Id= ;Password= ;"

Set objRs = objConn.Execute("SELECT * FROM DEMO.EMPLOYEE")

Response.Write " "

objRs.Close objConn.Close %>

