ok, I found this sample on the internet:http://authors.aspalliance.com/steve...les/sprocs.asp

I can't seem to figure out how to make it optimal for vb.net
Below is the sample code and below that, my code. I have mine in a function and it's called from a try block so I don't know what error exactly is being caught (I COULD, just too lazy right now lol)

What I'm having problems with is the SET command, I THINK I got that, you tell me.



VB Code:
  1. Dim objConn
  2. Dim objCmd
  3.  
  4. 'Instantiate objects
  5. Set objConn     = Server.CreateObject("ADODB.Connection")
  6. set objCmd      = Server.CreateObject("ADODB.Command")
  7. conn.Open Application("ConnectionString")
  8.  
  9. With objCmd
  10.     .ActiveConnection = conn 'You can also just specify a connection string here
  11.     .CommandText = "sp_InsertArticle"
  12.     .CommandType = adCmdStoredProc 'Requires the adovbs.inc file or typelib meta tag
  13.    
  14.     'Add Input Parameters
  15.     .Parameters.Append .CreateParameter("@columnist_id", adDouble, adParamInput, , columnist_id)
  16.     .Parameters.Append .CreateParameter("@url", adVarChar, adParamInput, 255, url)
  17.     .Parameters.Append .CreateParameter("@title", adVarChar, adParamInput, 99, url)
  18.     .Parameters.Append .CreateParameter("@description", adLongVarChar, _
  19.         adParamInput, 2147483647, description)
  20.    
  21.     'Add Output Parameters
  22.     .Parameters.Append .CreateParameter("@link_id", adInteger, adParamOutput, , 0)
  23.        
  24.     'Execute the function
  25.     'If not returning a recordset, use the adExecuteNoRecords parameter option
  26.     .Execute, , adExecuteNoRecords
  27.     link_id = .Parameters("@link_id")
  28. End With

VB Code:
  1. Public Function GetTicketNumber(ByVal Customer As String) As Integer
  2.         'Purpose    :   gets a ticket number for each ticket.  SP in database
  3.         'Accepts    :   customer name
  4.         'Notes      :   SP does all the work
  5.         Dim i As Integer
  6.  
  7.         With AdoCmd
  8.             .ActiveConnection = DB
  9.             .CommandText = "GenerateTicketNumber"
  10.             .CommandType = ADODB.CommandTypeEnum.adCmdStoredProc
  11.  
  12.             .Parameters.Append(.CreateParameter("@Name", ADODB.DataTypeEnum.adChar, ADODB.ParameterDirectionEnum.adParamInput, , Customer))
  13.             .Parameters.Append(.CreateParameter("@TicketNumber", ADODB.DataTypeEnum.adInteger, ADODB.ParameterDirectionEnum.adParamInputOutput, , 0))
  14.             .Execute()
  15.  
  16.         End With
  17.  
  18.     End Function

Here are the variables. I use the connection and recordse objects throughout the project. It may be that I can't use those same objects in my adocmd object?

VB Code:
  1. Public DB As New ADODB.Connection           'This is for a global ado database connection
  2.     Public RS As New ADODB.Recordset            'This is for a global ado recordset
  3.     Public AdoCmd As New ADODB.Command          'Used for Stored Procedures

I am TOTALY lost on this one. I don't have an option BUT to use ado or I'd use ado.net.