ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Connecting to SQL from Excel (https://www.excelbanter.com/excel-programming/324418-connecting-sql-excel.html)

Keith La Force

Connecting to SQL from Excel
 
Can any one tell me what is the correct function(s) to connect to a SQL 2000
Database, run a query, and put it in the spreadsheet using VBA for Excel
2000. Thanks for any help in advance.

Tom Ogilvy

Connecting to SQL from Excel
 
Look in the menu at Data=Get External Data (or equivalent)

--
Regards,
Tom Ogilvy

"Keith La Force" wrote in message
...
Can any one tell me what is the correct function(s) to connect to a SQL

2000
Database, run a query, and put it in the spreadsheet using VBA for Excel
2000. Thanks for any help in advance.




Keith La Force

Connecting to SQL from Excel
 
Hi, yes I can do it through Data=Import Data in Excel, but I want to do it
programatically, through VBA.

"Tom Ogilvy" wrote:

Look in the menu at Data=Get External Data (or equivalent)

--
Regards,
Tom Ogilvy

"Keith La Force" wrote in message
...
Can any one tell me what is the correct function(s) to connect to a SQL

2000
Database, run a query, and put it in the spreadsheet using VBA for Excel
2000. Thanks for any help in advance.





Jim Thomlinson[_3_]

Connecting to SQL from Excel
 
Not trying to be difficult but why in VBA. Unless you need to write back to
the database, there are very few good reasons to do it through code? You can
record a macro of Data=Import Data which is a whole lot easier than getting
into the ADO recordsets you need otherwise.

"Keith La Force" wrote:

Hi, yes I can do it through Data=Import Data in Excel, but I want to do it
programatically, through VBA.

"Tom Ogilvy" wrote:

Look in the menu at Data=Get External Data (or equivalent)

--
Regards,
Tom Ogilvy

"Keith La Force" wrote in message
...
Can any one tell me what is the correct function(s) to connect to a SQL

2000
Database, run a query, and put it in the spreadsheet using VBA for Excel
2000. Thanks for any help in advance.





Keith La Force

Connecting to SQL from Excel
 
Hi, well I needed to do some complex string manipulation, but I figured out
how to do it. Thanks for all you help anyway.

"Jim Thomlinson" wrote:

Not trying to be difficult but why in VBA. Unless you need to write back to
the database, there are very few good reasons to do it through code? You can
record a macro of Data=Import Data which is a whole lot easier than getting
into the ADO recordsets you need otherwise.

"Keith La Force" wrote:

Hi, yes I can do it through Data=Import Data in Excel, but I want to do it
programatically, through VBA.

"Tom Ogilvy" wrote:

Look in the menu at Data=Get External Data (or equivalent)

--
Regards,
Tom Ogilvy

"Keith La Force" wrote in message
...
Can any one tell me what is the correct function(s) to connect to a SQL
2000
Database, run a query, and put it in the spreadsheet using VBA for Excel
2000. Thanks for any help in advance.





All times are GMT +1. The time now is 11:52 PM.

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