Wrox Programmer Forums
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 28th, 2007, 09:59 PM
Authorized User
Join Date: May 2007
Posts: 73
Thanks: 4
Thanked 0 Times in 0 Posts
Default Command text was not set for the command object

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.




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"

Old May 29th, 2007, 12:54 AM
Friend of Wrox
Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts

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"
Old May 29th, 2007, 12:57 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

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 Spaanjaars
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.

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

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.