ASP Database Connection

Associate
Joined
29 May 2005
Posts
144
Hello, I have the following connection in my ASP website for my access database, but have recently converted over to oracle. I'm unsure on how I would go about editing this so it could connect to oracle instead of my access database.

Does anyone know of the syntax (code) which would be used to do this?

Thanks again, MoFish ;)

My orcacle database has the following information to login:
server: OrclServ
username: MoFish
password: OOPS

Code:
<%
Dim CN, DatabaseName, MdbFilePath
Set CN=Server.CreateObject("ADODB.Connection")
'DatabaseName = "../Files/mofish..mdb"
'MdbFilePath=Server.MapPath(DatabaseName)
'CN.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath &";"

CN.Open "Data Source=" & Server.Mappath("../Files/mofish.mdb") & ";Provider=Microsoft.Jet.OLEDB.4.0;"
%>
 
get onto the oracle web site

technet.oracle.com

download the Oracle ADODB connector for .net that matches your DB version

include the DLL with your ASP.net project and go for it.

the syntax (and properties) of the ADODB connection will be different, I have some projects at work that use it so I'll try to post some more stuff tomorrow.

DON'T bother with microsoft's Oracle client libraries they are not worth the bandwidth to download.

HT
 
Last edited:
I presume you got it working?

I'm using the 10g oracle client

and I put this at the top of the C# file:

using Oracle.DataAccess.Client;

and refernce the dll in the project settings.

the connection string that you will need is

Password=OOPS;Persist Security Info=True;User ID=MoFish;Data Source=OrclServ
 
Back
Top Bottom