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

  • Home
  • SEARCH
  • 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 3278724
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:30:45+00:00 2026-05-17T19:30:45+00:00

I need to modify some legacy code that was written in classic ASP (VBscript).

  • 0

I need to modify some legacy code that was written in classic ASP (VBscript).

I have a line that sets a database connection like this:

set m_conn=OpenConn()

I believe that the OpenConn() function is in a DLL somewhere. This is bad news because we can’t locate the source for that dll. So, I’ve been working on a replacement for that function. This is what i have so far:

function OpenConn()

dim conn
set conn = server.CreateObject("adodb.connection")
conn.open "XXXXconnection-stringXXXXX"  
OpenConn = conn

end function

When I try to run the original line set m_conn=OpenConn() (line 50) I get an ASP error:

Microsoft VBScript runtime error '800a01a8' 

Object required: '[string: "Provider=SQLOLEDB.1;"]' 

/path/to/include.asp, line 50 

I’m not too clear on how this syntax is supposed to work. Usually, I work in C#, but when I need to do things like this in ASP I’d use syntax like this:

set conn = server.createobject("adodb.conection")
conn.activeconnection = "connectionstring"
conn.execute "sql"
set conn = nothing

Anyway, I’m looking for the correct syntax for OpenConn() so that set m_conn=OpenConn() will work correctly.

Thanks for any help.

  • 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-17T19:30:46+00:00Added an answer on May 17, 2026 at 7:30 pm

    After a little more poking around, I figured it out.

    The function definition should have been:

    function OpenConn() 
    
        dim conn 
        set conn = server.CreateObject("adodb.connection") 
        conn.open "XXXXconnection-stringXXXXX"   
    
        set OpenConn = conn  ' change - added "set"
    
    end function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a row of data that I need to modify in a database,
I need to modify some legacy javascript code. There's a place where I want
I'm making some changes to a legacy classic ASP application. I've made the changes
I need some software to explore and modify some SQLite databases. Does anything similar
I need to modify some logic of Javascript Intellisense on Visual Studio 2008 SP1
I have a task that I need to perform for a friend as a
I have an application that uses DBF files and I need to import them
I have a windows service that reads from a config file. I need to
My scenario is : I've an excel sheet. Some threads need to modify it
I need to modify a (xml-)file from Apache Ant. loadfile task allows to load

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.