How do you call an SQL Server Stored Procedure from Access?

  • Thread starter Thread starter Marco Napoli
  • Start date Start date
Not very glamorous, but it works for me (you would want to add some error
handling):


Private Sub cmdRefreshClientPmts_Click()

Dim cnn As ADODB.Connection
Set cnn = New ADODB.Connection
cnn.ConnectionString = "Provider = SQLOLEDB;Data Source = ServerName; " & _
"Initial Catalog=dbname; User id=someusername;
password=somepassword"
cnn.Open

cnn.RefreshClientPmt 'This is my stored procedure call

MsgBox ("Records refreshed")

cnn.Close

End Sub


--
Kevin Hill
President
3NF Consulting

www.3nf-inc.com/NewsGroups.htm
 
Thank you so much.

Marco

Kevin3NF said:
Not very glamorous, but it works for me (you would want to add some error
handling):


Private Sub cmdRefreshClientPmts_Click()

Dim cnn As ADODB.Connection
Set cnn = New ADODB.Connection
cnn.ConnectionString = "Provider = SQLOLEDB;Data Source = ServerName; " &
_
"Initial Catalog=dbname; User id=someusername;
password=somepassword"
cnn.Open

cnn.RefreshClientPmt 'This is my stored procedure call

MsgBox ("Records refreshed")

cnn.Close

End Sub


--
Kevin Hill
President
3NF Consulting

www.3nf-inc.com/NewsGroups.htm
 
Back
Top