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 6205647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:18:40+00:00 2026-05-24T05:18:40+00:00

I am in need of using Classic ASP with Access. This is a requirement

  • 0

I am in need of using Classic ASP with Access. This is a requirement unfortunately. I currently have a script which connects to the Access DB just fine. Here is the snippet:

Set adoCon = Server.CreateObject("ADODB.Connection")

adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db1.mdb")

Set rsGuestbook = Server.CreateObject("ADODB.Recordset")

strSQL = "SELECT * from table1;"

rsGuestbook.Open strSQL, adoCon

Again, this snippet works just fine, records sent to browser.

When I apply this connection to a different script, I get an error returned which states:
Microsoft VBScript compilation error ‘800a0415’
Expected literal constant
Const ConnectionString = “DRIVER={Microsoft Access Driver (*.mdb)} DBQ=” & Server.MapPath(“db1.mdb”)

Here is the connection snippet:

Const ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db1.mdb")  

Appreciate any guidance anyone can throw my way, I know this is some old school, anyone else remeber when this stuff was bleeding edge? LOL I do…

  • 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-05-24T05:18:41+00:00Added an answer on May 24, 2026 at 5:18 am

    Don’t use a constant for your connection string. Since Server.MapPath is indeterminate (paths could change from one run to the next), Const is complaining. Or, it might complain with any concatenation when assigning a constant, I can’t remember for sure…

    Instead, change:

    Const ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db1.mdb")   
    

    to:

    Dim ConnectionString 
    ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db1.mdb")   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML file which I need to parse using PHP and send
I need to call a web service from my classic ASP website. I have
I need to get visitors country information using classic asp 3.0, i'm using below
Need help I have following code with classic asp <select name=state id=state> <option value=NJ>New
I have my recent E-learning web site developed in Classic ASP. However, I need
I have to deploy a classic ASP site through TFS 2010. This site has
I am in need of using classic ASP to create an XML file from
I need to get the Windows domain name from Internet Explorer using classic asp
I am using classic ASP. I have a stylesheet that is loaded into RAM
I just downloaded Notepad++ because I need to work on a classic asp project.

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.