Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 28th, 2007, 09:59 PM
Authorized User
Points: 395, Level: 6
Points: 395, Level: 6 Points: 395, Level: 6 Points: 395, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2007
Location: London, , United Kingdom.
Posts: 73
Thanks: 4
Thanked 0 Times in 0 Posts
Default Command text was not set for the command object

Hi
I m getting the following error message:

Error Type:
Microsoft JET Database Engine (0x80040E0C)
Command text was not set for the command object.
/dbdisplay.asp, line 18

Will b great if someone help me out.

Cheers

------------------------------------------



<% @LANGUAGE = VBSCRIPT %>


option Explicit
<%
set con=server.CreateObject ("ADODB.Connection")
set rs=server.CreateObject ("ADODB.Recordset")

  DBStr="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &_
        "C:\Inetpub\wwwroot\admin\webdb.mdb" & ";"


   sql = "select * from menu"

  con.Open DBStr

  set rs = con.Execute (str)
 Response.Write "connection established"

 %>
__________________
Cheers
Sheraz
Reply With Quote
  #2 (permalink)  
Old May 29th, 2007, 12:54 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Amman, , Jordan.
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Default

if that exactly your code then i suppose ur error is at this line
set rs = con.Execute (str)
i think it should be
set rs = con.Execute (sql)
:)



Nothing is impossible. The impossible only takes longer. "Digital Fortress, Dan Brown"
Reply With Quote
  #3 (permalink)  
Old May 29th, 2007, 12:57 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Also, try wrapping Option Explicit in a server side block:

<% Option Explicit %>

With that setting on, you would have caught and fixed the error much earlier...

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Issues with Command Object and Parameters BSkelding Crystal Reports 0 May 2nd, 2007 10:29 AM
Command text was not set for the command object. deepa12 BOOK: Beginning ASP 3.0 5 November 2nd, 2004 05:37 PM
Help! 'Command object error' sisi Classic ASP Databases 4 May 25th, 2004 06:23 PM
command object scrolling qwprince Classic ASP Databases 3 July 24th, 2003 09:29 AM



All times are GMT -4. The time now is 03:13 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.