• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

Using ActiveX Data Objects

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
clsmaster
Asked:
clsmaster
1 Solution
 
mcixCommented:
First, which OS are you running on?

Second, What version of Personal Web Server are you running?
0
 
percynCommented:
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
 
clsmasterAuthor Commented:
Where can I get the lastest copy.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
gasimCommented:
<% 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
 
clsmasterAuthor Commented:
The answer was caused by an incorrectly registered class.
0
 
ajoy092498Commented:
Just check the installation of PWS.
0
 
MasseyMCommented:
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

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now