Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Calling and Processng a stored Procedure with IIS 5 and Access 2000


Message #1 by ghartge@u... on Fri, 22 Nov 2002 14:41:46
OK,

Patience please. I have followed the example in the book Begining ASP
Databases on pages 546 to 552 and cannot get a very simple call to a stored
procedure to work. The procedure, ProcedureTest, that is sitting in my
Access 2000 database on my web server is:

PARAMETERS strID Text ( 255 );
SELECT [phd].[UUID]
FROM phd
WHERE ((([phd].[UUID])=[strID]));  <--- Tried with [ ] and without

The code on my ASP page is:
'**************************************************************
DIM SQLSLCT, objRS, objCmd, adopenstatic, adLockReadOnly

adLockReadOnly = 1
adopenstatic = 2

Set SQLSLCT=Server.CreateObject("ADODB.Connection")
connectstring = "Provider=Microsoft.Jet.OLEDB.4.0"

connectstring = connectstring & "; Data Source 
E:\Internet\idbase\DegreeApplication_Editorial.mdb"

SQLSLCT.connectionstring = connectstring
SQLSLCT.open

Dim strID
strID = "141666539" <----- Tried with and without quotes and single quotes
Set objCmd = Server.CreateObject("ADODB.Command")
Set objCmd.ActiveConnection = SQLSLCT
objCmd.CommandText = "{CALL ProcedureTest ('" & CStr(strID) & "')}"
Set objRS = Server.CreateObject("ADODB.Recordset")
Set objRS = objCmd.Execute  <---------- Line 82 (See error below)
Response.Write strID

'*************************************************************

THE ERROR I RECEIVE IS
    * Error Type:
      Microsoft JET Database Engine (0x80040E14)
      Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
'SELECT', or 'UPDATE'.
/editorial2/test.asp, line 82

  Return to Index