Solved

Using ActiveX Data Objects

Posted on 1998-08-27
7
180 Views
Last Modified: 2013-12-25
Hello I'm try to develop a web site on my computer using Personal Web Server as the testing plateform.  When I use the following lines

set rs = Server.CreateObject("ADODB.Recordset")
  rs.open "SELECT * FROM Directors WHERE Region=" & Request.Querystring("Region"), "DSN=AirMLS;uid=" & Application("uid") & ";pwd=" & Application("pwd"), 0, 1
  where = 1

I get a class not registered error.  How do I go about fixing this error.  The ActiveX Data Object are registered on the computer because I can easily use them from within VB5.  So what do I have to do to make them available from the Personal Web Server.
0
Comment
Question by:clsmaster
7 Comments
 
LVL 4

Expert Comment

by:mcix
ID: 1854604
First, which OS are you running on?

Second, What version of Personal Web Server are you running?
0
 
LVL 3

Expert Comment

by:percyn
ID: 1854605
If you get a Class not registered error, it would happen before it even gets to the Rs.Open statement.

There are several versions of OleDB floating out there...install the latest one.
0
 

Author Comment

by:clsmaster
ID: 1854606
Where can I get the lastest copy.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 1

Expert Comment

by:gasim
ID: 1854607
<% SET rs = Server.CreateObject("ADODB.Recordset")
rs.open "DSN=AirMLS;UID=" & Application("uid") & ";pwd==" & Application("pwd")" "
MyQuery="SELECT * FROM Directors WHERE Region=" & Request.Querystring("Region")"
Set myQueryRS= rs.Execute(MyQuery)%>

Always try to set you query in a variable before calling Open method.
0
 

Author Comment

by:clsmaster
ID: 1854608
The answer was caused by an incorrectly registered class.
0
 

Expert Comment

by:ajoy092498
ID: 1854609
Just check the installation of PWS.
0
 
LVL 10

Accepted Solution

by:
MasseyM earned 50 total points
ID: 1854610
It has nothing to do with PWS... Get the newest database drivers from Microsoft... here is the URL: http://microsoft.com/data/mdac2.htm

Also, you code should look something like this:
<%
    Set conn = Server.CreateObject("ADODB.Connection")
    conn.open "airMLS",Application("uid"),Application("pwd")
    Set Session("airMLS_conn") = conn
%>
<%
    sql = "SELECT * FROM Directors WHERE Region=" & Request.Querystring("Region") & ";"
    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open sql, conn, 3, 3
%>

That is the proper database connection setup...

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
The viewer will learn how to dynamically set the form action using jQuery.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question