Updating field from Stored Procedure

Results 1 to 2 of 2

Thread: Updating field from Stored Procedure

  1. #1
    Join Date
    Dec 1969

    Default Updating field from Stored Procedure

    Hello again, I have no idea what&#039;s wrong with the following code, can someone please help me.<BR><BR>I am trying to update a field from a stored procedure if the length of a date field is less than 8 characters. <BR>****************ASP*************************** *********<BR> Dim oRS<BR> Dim conn<BR> Dim cmd <BR> On Error Resume Next<BR> Set oRS=Server.CreateObject("adodb.recordset")<BR> Set conn=Server.CreateObject("adodb.connection") <BR> conn.open DB_CONNECTION_XP<BR> Set cmd = Server.CreateObject("ADODB.Command") <BR> cmd.ActiveConnection = conn <BR> cmd.CommandType = adCmdStoredProc <BR> cmd.CommandText = "UpdateStatus" <BR> Set oRS = cmd.Execute<BR><BR>************Stored Procedure****************<BR>CREATE PROCEDURE UpdateStatus AS<BR>BEGIN<BR>Update GBOrderEntry<BR>Set OrderStatus = &#039;TESTING&#039;<BR>Where LEN(TDate) &#060; 8 <BR>End

  2. #2

    Default RE: Updating field from Stored Procedure

    Why use a recordset and command object ? Just use the connection object on its own...<BR><BR>Dim dbconn, sql<BR>dbconn = server.createObject("adodb.connection")<BR>dbconn. open DB_CONNECTION_XP<BR>sql = "{call UpdateStatus}"<BR>dbconn.execute sql<BR><BR>try executing the SPROC from within SQL Server. If it executes within SQL server, your ASP invocation of the SPROC is syntactically incorrect

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts