Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default 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.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting Excel 2007 to MySQL db? Abel MacAdam Excel Discussion (Misc queries) 0 July 29th 09 01:17 PM
connecting wordpad and excel Jan Excel Discussion (Misc queries) 1 May 4th 07 01:37 PM
Connecting a form to an Excel workbook... Mr. Smiley Excel Discussion (Misc queries) 2 November 3rd 05 12:46 PM
Connecting to excel datasheets using C# Narwe Excel Programming 1 November 22nd 04 02:01 PM
Excel Connecting to SQL Server Database - Need your Help Rajesh G Excel Programming 2 February 27th 04 08:01 PM


All times are GMT +1. The time now is 05:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"