ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dynamic Link to SQL (https://www.excelbanter.com/excel-programming/273107-re-dynamic-link-sql.html)

Mark Bigelow

Dynamic Link to SQL
 
Certainly, just use the Workbook_Open() event to run your SQL code.

E.g.,

Private Sub Workbook_Open()

' Insert code to run SQL here

End Sub

---
Mark Bigelow
mjbigelow at hotmail dot com
http://hm.imperialoiltx.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Lynn[_2_]

Dynamic Link to SQL
 
Can I access a store proc or only tables/views.


-----Original Message-----
Certainly, just use the Workbook_Open() event to run your

SQL code.

E.g.,

Private Sub Workbook_Open()

' Insert code to run SQL here

End Sub

---
Mark Bigelow
mjbigelow at hotmail dot com
http://hm.imperialoiltx.com

*** Sent via Developersdex http://www.developersdex.com

***
Don't just participate in USENET...get rewarded for it!
.


Mark Bigelow

Dynamic Link to SQL
 
You can access a stored procedure, as long as it's stored in an open
workbook or add-in. Just call it like you normally would, unless it's
in an inactive (but still open) workbook, in which case you would call
it thus:

Application.Run(strWorkbookName & "!My_Proc", argument1, argument2)

---
Mark Bigelow
mjbigelow at hotmail dot com
http://hm.imperialoiltx.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 05:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com