Jump to content

Recommended Posts

Posted

Olá boa tarde,

Alguém me sabe dizer como é que eu executo as stored procedures através do vba? Bem e já agora como faço a ligação aos endereços da base de dados em sql server.

Obrigada

Posted

Olá,

Podes fazer algo do género usando ADO

   Set cnn = New ADODB.Connection
   sConnString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;" & _
       "Persist Security Info=False;" & _
       "Initial Catalog=databasename;" & _
       "Data Source=servername"
   With cnn
      .Open sConnString
      .up_UpdateSpreadsheetData .Range("A1").Value, .Range("B1").Value, .Range("C1").Value
   End With

Podes também ver estes exemplos que explicam mais em detalhe:

http://www.itjungle.com/mgo/mgo102203-story01.html

http://www.itjungle.com/mgo/mgo081503-story02.html

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.