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
Solved

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

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add server behaviors to Dreamweaver CC 2015 2 185
Adding Datediff to staistics page 2 62
Attaching a file to SMTP in Classic ASP 1 42
Designing forms 3 18
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…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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