Print Page | Close Window

object required

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=2914
Printed Date: 29 March 2026 at 10:15am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: object required
Posted By: cuedog
Subject: object required
Date Posted: 21 May 2003 at 8:46am

I am getting an error saying object required. I know it has to do with the database connection. Here is the code

common.inc

Sub OpenDB()
'Using DSN, MySQL
 Set DbConn = Server.CreateObject("ADODB.Connection")
DbConn.Open "dataconn", "username", "password"
End Sub

read_article.asp

Call OpenDB()
Set rs = DbConn.Execute("Select articleurl,articlehead From Articles")

<% Do until rs.EOF%> 'This line is the error

How should I write the connection string?




Replies:
Posted By: ljamal
Date Posted: 21 May 2003 at 11:20am
Add
Dim DbConn
at the beginning of the page

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: cuedog
Date Posted: 21 May 2003 at 11:47am

Dim DbConn is outside of the sub opendb() I just didn't enter the whole file.

The error is saying I am trying to open a recordset without a database connection. I can't remember the way the sql statement and connection is supposed to be written. Tell me if this is right.

sql="Select * From Articles;"

Set rs = Dbconn.Open, sql




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net