Solved

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

Posted on 2003-11-24
4
803 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

628 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