PC Review


Reply
Thread Tools Rate Thread

How can I use VBA to connect to a SQL server?

 
 
=?Utf-8?B?QmVkIEd1eQ==?=
Guest
Posts: n/a
 
      29th May 2007
I want to use VBA to connect to a SQL server and run a SQL command that will
return data to a pivot table. The SQL command will be generated based on a
date range entered into a couple of cells (at least that is my first thought
on how to do this). My goal is to have the user be able to enter the date
range, click refresh, and the the pivot table will be updated with that data.
I'm somewhat new to using visual basic in Excel so I'm not really sure where
to start at this point. I'm sure I haven't given out enough information at
this time and I apologize for that.

Any help is greatly appreciated!

Marc
 
Reply With Quote
 
 
 
 
Tim
Guest
Posts: n/a
 
      29th May 2007
Search the web past posts on "Sql Server" and "ADO": you should be able to
find examples.

Tim

"Bed Guy" <(E-Mail Removed)> wrote in message
news:B083C0B8-8EA2-48F8-845E-(E-Mail Removed)...
>I want to use VBA to connect to a SQL server and run a SQL command that
>will
> return data to a pivot table. The SQL command will be generated based on
> a
> date range entered into a couple of cells (at least that is my first
> thought
> on how to do this). My goal is to have the user be able to enter the date
> range, click refresh, and the the pivot table will be updated with that
> data.
> I'm somewhat new to using visual basic in Excel so I'm not really sure
> where
> to start at this point. I'm sure I haven't given out enough information
> at
> this time and I apologize for that.
>
> Any help is greatly appreciated!
>
> Marc



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
IMAP server cannot connect to IMAP server, Connect error 10061 BobW Windows Vista Mail 2 7th Jan 2009 12:56 AM
Connect SQL server via USB give "Server does not exist or access denied" after few succeful connect. but always work wireless Vincent Microsoft Dot NET Compact Framework 4 5th Sep 2006 01:51 AM
How do i change this connect string to support a SQL Server 2000 running on port 8832 User ID=car;Password=rat;Server=abc.def.hij;Initial Catalog=foobar i tried Server=abc.def.hij:8823 and Server=abc.def.hij;port=8823 neither of these work Daniel Microsoft Dot NET Framework 1 16th Dec 2004 09:55 PM
Can connect to Internet - can't connect to server Kristian Wentzel Windows XP Internet Explorer 2 23rd Sep 2004 01:54 PM
Can't connect to Internet thru router - can't connect to DHCP server. Madison Lapierre Windows XP General 0 14th Mar 2004 10:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:51 PM.