Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
SQL Server -- Bulk Insert from Excel to SQL Server | Excel Discussion (Misc queries) | |||
Excel 2003 Error Cannot Locate the Internet Server or Proxy Server | Excel Discussion (Misc queries) | |||
problem updating link from Novell server to windows server #REF er | Excel Discussion (Misc queries) | |||
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?) | Excel Programming | |||
Best way to get data out of SQL Server | Excel Programming |