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 July 17th, 2006, 08:30 PM
Registered User
 
Join Date: May 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Store Procedures

Hi,

Just made a Stored Procedure using Access. When it is used, IE is saying that it is looking at an Invalid SQL statement. When the SQL code is copies from Access, the program works. Code below, one uses the Select method, the other the Stored Procedure:

<% @language="vbscript" %>
<% option explicit %>


<html>
<head>
    <title>Untitled</title>
</head>

<body>

Try it out
<%

Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")

objRS.Open "qAllNewBoats", "DSN=Sailor1", adOpenForwardOnly

'objRS.Open "SELECT Boats.Boat_Class FROM Boats;", "DSN=Sailor1"

Do While Not objRS.EOF
Response.write objRS("Boat_Class") & "<p>"
objRS.MoveNext
Loop
objRS.Close
Set objRS=Nothing
%>

</body>
</html>

Note:'objRS.Open "SELECT Boats.Boat_Class FROM Boats;", "DSN=Sailor1"
is copied from Access SQL in the Stored Procedure.

Why won't it work!!!

Thks,

Joe
 
Old July 20th, 2006, 01:02 AM
Authorized User
 
Join Date: Apr 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, my memory with ASP and stored procedures is a bit fuzzy... BUT.. i think you need exec before your procedure name:

ex.

objRS.Open "exec qAllNewBoats", "DSN=Sailor1", adOpenForwardOnly






Similar Threads
Thread Thread Starter Forum Replies Last Post
2 procedures? scandalous Access 5 January 26th, 2007 05:06 PM
User-defined type as input for store procedures davidb BOOK: Professional Java Development with the Spring Framework 0 August 11th, 2005 02:49 PM
Store Procedures ! augustine SQL Server 2000 1 September 15th, 2004 01:29 PM
Regarding Procedures spraveens MySQL 1 March 10th, 2004 10:08 AM





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