Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling Stored Procedures

Status
Not open for further replies.

Jechols

MIS
Jul 1, 2005
9
US
Does anyone know of a good book/site to quickly learn the fundamental steps of calling stored procedures from Access? Thanks so much.
 
Access doesn't have storedprocs..

It has functions and sub procs...

What do you want?
 
That depends on some variables. If you turn ANSI SQL on, I believe Access will allow you to write stored procedures. If memory serves me correctly, you also categorize saved queries as stored procedures in VB.Net to get them working with the OLEDB provider. This may only be non-select queries.
 
You can run other queries(sp's) besides select as well -- INSERT/UPDATE/APPEND etc...

I copied this from somewhere and would give credit if I knew it....when you need to call an sp in access:

Code:
Call execute_storedProc("sp_name")

which calls this (ExecuteNonQuery tells it not to expect any return values -- just runs the sp's):
Code:
Friend Sub execute_storedProc(ByVal sp As String)
        Dim nextsortOrder As Integer
        Dim cmd1 As New OleDb.OleDbCommand
        With cmd1
            .Connection = objConn
            .CommandType = CommandType.StoredProcedure
            .CommandText = sp
        End With
        objConn.Open()
        nextsortOrder = cmd1.ExecuteNonQuery()
        objConn.Close()
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top