Solved

Object required: '[string: "SELECT DocumentType "]'

Posted on 2003-11-24
4
801 Views
Last Modified: 2007-12-19
Greets all,

I am trying to make a DSN-Less connection (for the first time,, always used DSN until it seems to be screwing up now,,,)  So im Trying to set up a new connection.

I created an include file called "Connection.inc" with code :
Dim DATA_PATH
  Set DATA_PATH = "..."
Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
  Conn.Open "DBQ=" & DATA_PATH &   ";Driver={Microsoft Access Driver (*.mdb)};

And then included this in the main file and used
Dim SQL
  Set SQL = "SELECT DocumentType FROM DocumentTypeDatabase ORDER by DocumentType"
RS.open SQL, Conn

I cant seem to access any of the information in the database and I get the error :

Microsoft VBScript runtime error '800a01a8'

Object required: '[string: "SELECT DocumentType "]'

/filetransfer/myfiles.asp, line 39

Everything worked fine with a DSN connection, So there has to be something im doing wrong with the DSN-Less Connection setup.  Could you please help?  

regards,

Ian.
0
Comment
Question by:darksinclair
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 15

Accepted Solution

by:
deighc earned 50 total points
ID: 9811737
You're using the Set keyword on a non-object variable

Set SQL = "SELECT DocumentType FROM DocumentTypeDatabase ORDER by DocumentType"

Set is used for object variables only. Change it to:

SQL = "SELECT DocumentType FROM DocumentTypeDatabase ORDER by DocumentType"
0
 
LVL 15

Expert Comment

by:deighc
ID: 9811746
Same problem here:

Set DATA_PATH = "..."

Should be:

DATA_PATH = "..."
0
 
LVL 5

Author Comment

by:darksinclair
ID: 9813803
Thanks deighc, but could I ask you, Now i receive
Microsoft VBScript runtime error '800a01a8'

Object required: ''

/filetransfer/myfiles.asp, line 40

where Line 40 is :       RS.open SQL, Conn
and SQL and Conn have been changed to not be Set

Thanks, Much Appreciated!

Ian.
0
 
LVL 15

Expert Comment

by:deighc
ID: 9816534
You SHOULD use Set when creating Conn - Conn is an object variable (a connection object).
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 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