Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Writing data to SQL server

Hello all, I have need to be able to:
- upon openning up an excel spreadsheet, read data from a SQL server to
populate an excel spreadsheet "form"
- allow the use to modify or add to the data
- be able to save the data back to the SQL server

Essentially, I need to be able to read and write excel data to and from a
SQL server using Excel VBA.

I've googled and can't find anything similar to what I've described yet I'm
sure someone has already done something similar and don' need to reinvent
the wheel.

Can anyone point me in the right direction or offer some suggestions?

Any help will be appreciated.

Thanks
Jim



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Writing data to SQL server

This can be done and there are examples out there. First, though, this type
of application lends itself better to MS Access than to Excel, so if you have
a choice consider doing this in Access. But if you need to use Excel you can.

The best way to accomplish this is with ADO - ActiveX Data Objects. You
need to add a reference to it into your VBA project (Tools... References from
the VBA editor - you will find it under Microsoft ActiveX Data Objects). ADO
lets you connect to and query an external database (query includes both
looking up info and updating/appending info - as long as you have a
userID/password with the necessary permissions). Here is a general reference
for using ADO - there is a lot to it but the features you would need to
implement what you want to do are not terribly difficult
http://msdn.microsoft.com/library/de...prg01_1kwv.asp

Here is a more specific example of ADO used to retrieve and update data from
a SQL server database
http://msdn.microsoft.com/library/de...mthupdatex.asp

For more examples, try a search on this site for the terms "ADO" or "SQL
server" - then try in general the MSDN Library for "ADO Connection", "ADO
Recordset", "ADO Update" - and then try a general Web search on any related
topics.

--
- K Dales


"Jim" wrote:

Hello all, I have need to be able to:
- upon openning up an excel spreadsheet, read data from a SQL server to
populate an excel spreadsheet "form"
- allow the use to modify or add to the data
- be able to save the data back to the SQL server

Essentially, I need to be able to read and write excel data to and from a
SQL server using Excel VBA.

I've googled and can't find anything similar to what I've described yet I'm
sure someone has already done something similar and don' need to reinvent
the wheel.

Can anyone point me in the right direction or offer some suggestions?

Any help will be appreciated.

Thanks
Jim




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Writing data to SQL server

Unfortunately, I have to use Excel because I have a good deal of VBA
customization in the spreadsheet in the form of utilities and customization
that drives the form. I just need to be able to pull data from SQL server
and then push it back once done.

Thanks for the tips!
I'll check them out.



"K Dales" wrote in message
...
This can be done and there are examples out there. First, though, this
type
of application lends itself better to MS Access than to Excel, so if you
have
a choice consider doing this in Access. But if you need to use Excel you
can.

The best way to accomplish this is with ADO - ActiveX Data Objects. You
need to add a reference to it into your VBA project (Tools... References
from
the VBA editor - you will find it under Microsoft ActiveX Data Objects).
ADO
lets you connect to and query an external database (query includes both
looking up info and updating/appending info - as long as you have a
userID/password with the necessary permissions). Here is a general
reference
for using ADO - there is a lot to it but the features you would need to
implement what you want to do are not terribly difficult:
http://msdn.microsoft.com/library/de...prg01_1kwv.asp

Here is a more specific example of ADO used to retrieve and update data
from
a SQL server database:
http://msdn.microsoft.com/library/de...mthupdatex.asp

For more examples, try a search on this site for the terms "ADO" or "SQL
server" - then try in general the MSDN Library for "ADO Connection", "ADO
Recordset", "ADO Update" - and then try a general Web search on any
related
topics.

--
- K Dales


"Jim" wrote:

Hello all, I have need to be able to:
- upon openning up an excel spreadsheet, read data from a SQL server to
populate an excel spreadsheet "form"
- allow the use to modify or add to the data
- be able to save the data back to the SQL server

Essentially, I need to be able to read and write excel data to and from a
SQL server using Excel VBA.

I've googled and can't find anything similar to what I've described yet
I'm
sure someone has already done something similar and don' need to reinvent
the wheel.

Can anyone point me in the right direction or offer some suggestions?

Any help will be appreciated.

Thanks
Jim






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Writing data to SQL server

Jim,

If you were able to find a solution to your problem, I am experiencing the
exact same issue currently. I would love some help!

David


"Jim" wrote:

Unfortunately, I have to use Excel because I have a good deal of VBA
customization in the spreadsheet in the form of utilities and customization
that drives the form. I just need to be able to pull data from SQL server
and then push it back once done.

Thanks for the tips!
I'll check them out.



"K Dales" wrote in message
...
This can be done and there are examples out there. First, though, this
type
of application lends itself better to MS Access than to Excel, so if you
have
a choice consider doing this in Access. But if you need to use Excel you
can.

The best way to accomplish this is with ADO - ActiveX Data Objects. You
need to add a reference to it into your VBA project (Tools... References
from
the VBA editor - you will find it under Microsoft ActiveX Data Objects).
ADO
lets you connect to and query an external database (query includes both
looking up info and updating/appending info - as long as you have a
userID/password with the necessary permissions). Here is a general
reference
for using ADO - there is a lot to it but the features you would need to
implement what you want to do are not terribly difficult:
http://msdn.microsoft.com/library/de...prg01_1kwv.asp

Here is a more specific example of ADO used to retrieve and update data
from
a SQL server database:
http://msdn.microsoft.com/library/de...mthupdatex.asp

For more examples, try a search on this site for the terms "ADO" or "SQL
server" - then try in general the MSDN Library for "ADO Connection", "ADO
Recordset", "ADO Update" - and then try a general Web search on any
related
topics.

--
- K Dales


"Jim" wrote:

Hello all, I have need to be able to:
- upon openning up an excel spreadsheet, read data from a SQL server to
populate an excel spreadsheet "form"
- allow the use to modify or add to the data
- be able to save the data back to the SQL server

Essentially, I need to be able to read and write excel data to and from a
SQL server using Excel VBA.

I've googled and can't find anything similar to what I've described yet
I'm
sure someone has already done something similar and don' need to reinvent
the wheel.

Can anyone point me in the right direction or offer some suggestions?

Any help will be appreciated.

Thanks
Jim







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
SQL Server -- Bulk Insert from Excel to SQL Server Madhan Excel Discussion (Misc queries) 0 December 12th 06 03:08 PM
Excel 2003 Error Cannot Locate the Internet Server or Proxy Server Seabee Excel Discussion (Misc queries) 0 November 20th 05 12:03 AM
problem updating link from Novell server to windows server #REF er Ellen Excel Discussion (Misc queries) 0 May 10th 05 09:18 PM
Q: Best way to take data from VBA into graphs without writing data to worksheets? (Can a named range refer to an array in memory only?) KR Excel Programming 2 December 16th 04 11:12 PM
Best way to get data out of SQL Server paul reed Excel Programming 2 October 3rd 03 10:34 AM


All times are GMT +1. The time now is 10:03 PM.

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

About Us

"It's about Microsoft Excel"