DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2008

    help with dsn-less connection for asp-mdb

    Get a 500 Internal server error when i try to make a dsn-less connection via asp to my hosted database. Can't figure out where the problem is Please help. I tried to troubleshoot the problem using a basic page that submits a hard coded value into the database to keep things simple. Thats the code i've provided here. Please point out where i'm going wrong.

    The path to the database was provided by my web host

    <%@ Language="VBScript" %>
    <% Option Explicit %>
    <title>ASP for database</title>
    'declare variables
    Dim vdiagnosis, diagnosis, sConnString, connection, sSQL
    diagnosis = "fever"
    vdiagnosis = diagnosis
    'declare SQL statement that will query the database
    sSQL = "INSERT into patient (diagnosis) values ('" & vdiagnosis & "')"
    response.write (sSQL)
    'define the connection string, specify database driver and the location of database
    sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & Server.MapPath("D:\inetpub\vhosts\ozonekb.com\httpdocs\db\ozone.mdb")
    response.write (sConnString)
    'create an ADO connection object
    Set connection = Server.CreateObject("ADODB.Connection")
    'Open the connection to the database
    'execute the SQL
    response.write "The form information was inserted successfully."
    'Done. Close the connection object
    Set connection = Nothing
    I've also tried with the alternative path ../db/ozone.mdb, but no results

  2. #2
    Join Date
    Dec 2008
    solved it - the error was a permissions problem with the database

  3. #3
    Join Date
    Apr 2007
    Sterling Heights, Michigan
    Thanks for coming back and letting us know.

Similar Threads

  1. DSN Connection to Access
    By Kyle in forum ASP.NET
    Replies: 1
    Last Post: 10-02-2001, 07:30 PM
  2. Replies: 1
    Last Post: 06-28-2001, 06:53 PM
  3. DSN less ADO connection for Text Files
    By David Croft in forum VB Classic
    Replies: 2
    Last Post: 12-11-2000, 03:01 PM
  4. DSN Less connection to Access through RDO
    By Anoop in forum VB Classic
    Replies: 2
    Last Post: 10-31-2000, 06:09 AM
  5. ODBC - Connection to DSN Name failed
    By saiful in forum VB Classic
    Replies: 0
    Last Post: 04-13-2000, 08:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.