Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8624055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:25:50+00:00 2026-06-12T07:25:50+00:00

I have an old ASP site (written a long time ago by a former

  • 0

I have an old ASP site (written a long time ago by a former employee) that connects to a 2003 ODBC database using DSN. The servers have been updated by our hosts to 2008, and we can no longer use ODBC so I have to make the connections DSN-Less.

Unfortunately I have very little knowledge of ASP, and database connections through ASP. I wonder if anybody can help me change the code to connect to the Access database without ODBC?

I think it connects using this code:

<%
' Get current name of region and intro text
Dim objRec, sql, introtext
sql="SELECT * FROM hometext WHERE home_id = 1"
set objRec=Server.CreateObject("ADODB.Recordset")
objRec.Open sql, "dsn=databasename"
introtext = Replace(objRec("home_introtext"), vbCrLf, "<br />")

' Get the 5 newest news items
Dim objRec2, sql2, newstext
sql2="SELECT TOP 5 news_date, news_text FROM news ORDER BY news_date DESC"
set objRec2=Server.CreateObject("ADODB.Recordset")
objRec2.Open sql2, "dsn=databasename"

' Get all images to appear to page
Dim objRec3, sql3
sql3="SELECT * FROM homeimages ORDER BY homeimage_date DESC"
set objRec3=Server.CreateObject("ADODB.Recordset")
objRec3.Open sql3, "dsn=databasename"

' Get the next 5 events from the current date
Dim objRec4, sql4
sql4="SELECT TOP 5 event_date, event_name FROM events WHERE event_date >= " &         niceDateAccess(Date()) & " ORDER BY event_date"
set objRec4=Server.CreateObject("ADODB.Recordset")
objRec4.Open sql4, "dsn=databasename"
%>

I’m not sure how it all connects, I’m not much of a scripter.

Any (dumbed down) help would be appreciated!

Thanks

EDIT: The database is sat in the ‘private’ folder in the root folder on the server.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:25:52+00:00Added an answer on June 12, 2026 at 7:25 am

    Here is a sample code. Change your database name and tablefield name

    set conob = Server.CreateObject("ADODB.Connection")
    conob.Provider="Microsoft.Jet.OLEDB.4.0"
    conob.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & server.MapPath("YourDatabaseName.mdb")
    Set rsuni = Server.CreateObject("ADODB.Recordset")
    sqlStr="select * from Student_Entry"
    
    rsuni.open sqlStr,conob
    

    You must give full access to your database by which user you are logged on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an old school ASP (note: not ASP.NET) web site that has a
I have an old ASP.NET 1.1 site that I am maintaining. We are working
I have an old .net 2005 web site that has some asp pages and
We have an old web app written in classic ASP. We don't have the
I have a templating system that looks similar to old-style ASP code. I run
I have in here an old web application written in ASP.Net 2.0 + AJAX.
I have two physical servers. The old one runs an ASP.NET site on IIS
I am designing a standard ASP.Net site with a SQL database. I have a
I have a ASP.Net 3.5 web site I developed on my old XP sp3
I have an IIS6 ASP.NET 2/3.5 site that ALWAYS seems to be caching anything

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.