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

K

Kevin3NF

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
 
M

Marco Napoli

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top