Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21236

why is this ADO call to this stored procedure not executing

$
0
0
I am completely frustrated as this shoudl work. Right ?:eek2:
Where I have it bolded those lines have been commented out to change the inline SQL query to a stored procedure without paramaters to be executed.

Code:

Private Sub updateIncludeNotes(lngTranKey As Long)
Dim cmd As New ADODB.Command
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
 Set cmd = New ADODB.Command
 cmd.CommandType = adCmdStoredProc
 cmd.CommandText = "spPanLetterUpdate"
  cmd.ActiveConnection = cn
'sql = "UPDATE tblTransDetail SET fldIncludeNotes = 0" & _
"WHERE" & _
"fldTranKey =" & lngTranKey

cn.Open strConnectionString
'rs.Open sql, cn, adOpenKeyset, adLockOptimisticOn Error GoTo ProcError
Set rs = cmd.Execute
cn.Close
Set rs = Nothing
Set cn = Nothing

ProcExit:
  Exit Sub


   
ProcError:
   
    MsgBox ("The updating Process for PanLetters failed. Please enter the changes manually. Thank You. ")
  Resume ProcExit



End Sub


Viewing all articles
Browse latest Browse all 21236

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>