Kenneth Ismert
kismert at gmail.com
Thu Sep 9 12:54:42 CDT 2010
> jwcolby: > > ... I would dearly LOVE to programmatically find the data in the web page > and insert it myself but I do not know how to do that... > Well, there is the RIGHT way to do it, and the WRONG way... ;) First, the RIGHT way: Build a web service that allows you to update the records in a completely generic, standards-compliant way. Any properly-credentialed client could add or update information on the site. This would add the most value to what you are giving your client. SOAP On the web side, you first would build a WSDL file which describes the service, then you would have to build a web service that supports entering the data, and returning success or an error. On the Access side, there are SOAP and REST COM automation objects that let you interact with a web service via VBA. I have used the SOAP object with VBA to interact with a PHP SOAP web service that I built, and it works. Here is an overview, using the SOAP Toolkit 2.0... http://www.soapuser.com/client4.html The latest is SOAP Toolkit 3.0 -- here is an example on the VBA side: http://oreilly.com/pub/h/1306 REST REST web services are simpler than SOAP, because you don't have to build a WSDL file describing the service. Calling is simpler, too, because you just create GETs or POSTs with data to URIs. Actually, building the web service is easier, too, because you don't have to decode a SOAP XML request to figure out what to do. Excel, VBA, and REST URLs - A Sample Application http://developer.webtrends.com/community/dx/blog/2009/08/26/excel-vba-and-rest-urls--a-sample-application How to call web services with REST instead of SOAP http://www.oreillynet.com/windows/blog/2004/09/how_to_call_web_services_with.html REST is not CRUD, and here’s why. http://blog.punchbarrel.com/2008/10/31/rest-is-not-crud-and-heres-why/ Then there is the WRONG way: Automate Internet Explorer to fill in the forms programmatically. This is wrong because it binds you to a particular browser, and will break if they change their web page. You would start an IE instance in code, and traverse the DOM tree for the page until you found the HTML that held the web controls you were looking for, and fill them in, and programmatically 'click' and update control. Depending on the complexity of the HTML page, and how it is structured, this could be moderately easy or very hard. If they want to interact with the browser while your program is working, that may add additional complexity. Automate Internet Explorer http://www.codeforexcelandoutlook.com/excel-vba/automate-internet-explorer/ InternetExplorer Object http://msdn.microsoft.com/en-us/library/aa752084%28VS.85%29.aspx -Ken