SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Newbie question: "Object Required"

  1. #1
    SitePoint Member
    Join Date
    Nov 2004
    Location
    SE Minnesota
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Newbie question: "Object Required"

    Hi there, I'm writing my first ASP-coded page and I'm getting an error I don't know how to fix. I know it's a fairly common one that can be caused by a number of things, and I figure it's pretty simple... but I don't know what's causing it.

    The page worked fine before I tried to make a connection to a MySQL db and pull out all the records. The connection itself is OK, I think (at least it didn't cause any errors)

    Code:
    Microsoft VBScript runtime  error '800a01a8'
    Object required: ''
    /pixel8labs.com-asp//gianna/tarot/index.asp, line 77
    Here is the relevant code:
    Code:
    ' Pull selected records from the database
    strQuery = "SELECT * FROM tarot"
    
    Set rsTarotData =adoDataConn.Execute(strQuery) <--- line 77
    
    If Not rsTarotData.BOF Then 
    	Do While Not rsTarotData.EOF %>
    
    	<div class="card">
    	<% Response.Write(rsTarotData("image").Value) %>
    	</div>
    
    	<% rsTarotData.MoveNext 
    	Loop
    Else
    	Response.Write("No records returned.") 
    End If %>
    My db interface is cut-and-pasted from a ASP faq so I'm assuming it's correct... I hope someone can help!

    Gianna

  2. #2
    Original Gangster silver trophy SitePoint Award Recipient Thing's Avatar
    Join Date
    Oct 2000
    Location
    Jackson, NJ
    Posts
    4,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your query looks ok so it is your db connection string adoDataConn. Post the code where you set that variable.

  3. #3
    SitePoint Member
    Join Date
    Nov 2004
    Location
    SE Minnesota
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here you go. Thanks for taking a look...

    Code:
    strConnection = "driver={MySQL};server=domain.com;uid=username;
    pwd=password;database=database" 
    
    Set adoDataConn = Server.CreateObject("ADODB.Connection")
    adoDataConn.Open strConnection

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •