1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ASP Database Connection

Discussion in 'HTML, Graphics & Programming' started by MoFish, 6 Mar 2006.

  1. MoFish

    Gangster

    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;"
    %>
    
     
  2. happytechie

    Soldato

    Joined: 18 Oct 2002

    Posts: 5,601

    Location: Surrey

    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
     
  3. MoFish

    Gangster

    Joined: 29 May 2005

    Posts: 144

    That would be super, thanks a bunch

    Mofish
     
  4. happytechie

    Soldato

    Joined: 18 Oct 2002

    Posts: 5,601

    Location: Surrey

    Last edited: 6 Mar 2006
  5. Dolmio Chips

    Gangster

    Joined: 27 Oct 2005

    Posts: 348

    Location: Gateshead, Tyne & Wear

  6. happytechie

    Soldato

    Joined: 18 Oct 2002

    Posts: 5,601

    Location: Surrey

    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