Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - object required
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

object required

 Post Reply Post Reply
Author
cuedog View Drop Down
Groupie
Groupie
Avatar

Joined: 29 December 2001
Location: United States
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote cuedog Quote  Post ReplyReply Direct Link To This Post Topic: object required
    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?

Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 21 May 2003 at 11:20am
Add
Dim DbConn
at the beginning of the page
Back to Top
cuedog View Drop Down
Groupie
Groupie
Avatar

Joined: 29 December 2001
Location: United States
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote cuedog Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.