<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>juust ~ php oddities &#187; xhr</title>
	<atom:link href="http://www.juust.org/index.php/tag/xhr/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.juust.org</link>
	<description>Link theory and search engine optimization</description>
	<lastBuildDate>Thu, 19 Jan 2012 09:39:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>how to get bing api search results in MsOffice VBA</title>
		<link>http://www.juust.org/index.php/how-to-get-bing-api-search-results-in-msoffice-vba/2011/12/</link>
		<comments>http://www.juust.org/index.php/how-to-get-bing-api-search-results-in-msoffice-vba/2011/12/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 23:27:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[bing]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[seo tips and tricks]]></category>
		<category><![CDATA[serp]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[vba]]></category>
		<category><![CDATA[xhr]]></category>

		<guid isPermaLink="false">http://www.juust.org/?p=1946</guid>
		<description><![CDATA[For the loyal VBA fans a quick snippet to grab search results from Bing in Access or Excel. There are few articles on the web about that, and that is a shame. So lets add some content on it to &#8230; <a href="http://www.juust.org/index.php/how-to-get-bing-api-search-results-in-msoffice-vba/2011/12/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For the loyal VBA fans a quick snippet to grab search results from Bing in Access or Excel. There are few articles on the web about that, and that is a shame. So lets add some content on it to the web : first in MsAccess VBA and then in Excel, with a <a href="http://www.juust.org/wp-content/uploads/file/sample_workbook_vba_bing_api.xlsm">sample workbook</a> added.</p>
<p>Working with the BING API requires an Application Id you can get <a href="http://www.bing.com/toolbox/bingdeveloper/">at the Bing website</a>.</p>
<h2>Accessing the Bing Api in MsAccess VBA</h2>
<p>In the the VBA Ide, through the menu <em>T</em>ools <em>R</em>eferences I add a reference to the XML object library that contains the XMLHTTPRequest object, enabling me to make HTTP requests from VBA in the MsAccess database.</p>
<p><a href="http://www.juust.org/wp-content/uploads/2011/12/add-xmlhttprequest-to-vba.png" rel="shadowbox[post-1946];player=img;"><img src="http://www.juust.org/wp-content/uploads/2011/12/add-xmlhttprequest-to-vba.png" alt="" title="add xmlhttprequest to vba" width="779" height="278" class="alignnone size-full wp-image-1947" /></a></p>
<p>The simple part is the http request string : </p>
<div class="geshi no vb">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Dim</span> MyKeyword <span class="kw1">As</span> <span class="kw1">String</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; MyKeyword = <span class="st0">&quot;seo&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Dim</span> requestString <span class="kw1">As</span> <span class="kw1">String</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; requestString = <span class="st0">&quot;http://api.bing.net/xml.aspx?&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Dim</span> AppId <span class="kw1">As</span> <span class="kw1">String</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; AppId = <span class="st0">&quot;(get one at the bing website)&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">&#39; Common request fields (required)</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; requestString = requestString &amp; _</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;AppId=&quot;</span> &amp; AppId &amp; <span class="st0">&quot;&amp;Query=&quot;</span> &amp; MyKeyword &amp; <span class="st0">&quot;&amp;Sources=Web&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">&#39; Common request fields (optional)</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; requestString = requestString &amp; _</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;&amp;Version=2.0&quot;</span> _</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp; <span class="st0">&quot;&amp;Market=en-us&quot;</span> _</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp; <span class="st0">&quot;&amp;Adult=Moderate&quot;</span> _</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp; <span class="st0">&quot;&amp;Options=&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">&#39; Web-specific request fields (optional)</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; requestString = requestString &amp; _</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;&amp;Web.Count=10&quot;</span> _</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp; <span class="st0">&quot;&amp;Web.Offset=0&quot;</span> _</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp; <span class="st0">&quot;&amp;Web.Options=DisableHostCollapsing+DisableQueryAlterations&quot;</span></div>
</li>
</ol>
</div>
<p>Then comes the working part, sending the actual request and receiving the XML response (<strong>objSvrHTTP.responseText</strong>) containing the search data. I use a DomDocument object and XPath to get at the XML data.</p>
<p>First sending the request</p>
<div class="geshi no vb">
<ol>
<li class="li1">
<div class="de1">&nbsp; &nbsp; objSvrHTTP.<span class="kw1">Open</span> <span class="st0">&quot;GET&quot;</span>, requestString, <span class="kw1">False</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; objSvrHTTP.<span class="me1">send</span> requestString</div>
</li>
</ol>
</div>
<p>then creating a domdocument and receiving the response in it</p>
<div class="geshi no vb">
<ol>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">&#39;Create the DomDocument Object</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">Dim</span> oDoc <span class="kw1">As</span> MSXML2.<span class="me1">DOMDocument</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">Set</span> oDoc = <span class="kw1">CreateObject</span><span class="br0">&#40;</span><span class="st0">&quot;MSXML2.DOMDocument&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; oDoc.<span class="me1">async</span> = <span class="kw1">False</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; oDoc.<span class="me1">validateOnParse</span> = <span class="kw1">False</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">&#39;Load the response in the DomDocument Object</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">Dim</span> fSuccess <span class="kw1">As</span> <span class="kw1">Boolean</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; fSuccess = oDoc.<span class="me1">loadXML</span><span class="br0">&#40;</span>objSvrHTTP.<span class="me1">responseText</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">If</span> <span class="kw1">Not</span> fSuccess <span class="kw1">Then</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">MsgBox</span> <span class="st0">&quot;failed&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Exit</span> <span class="kw1">Sub</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span></div>
</li>
</ol>
</div>
<p>The response uses two namespaces and the data we actually want is in the &#8220;web&#8221; namespace, so before we start selecting nodes in the xml-tree we first indicate what namespace we want to access :</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1">&nbsp; &nbsp; oDoc<span class="sy0">.</span>SetProperty <span class="st0">&quot;SelectionNamespaces&quot;</span><span class="sy0">,</span> <span class="st0">&quot;xmlns:web=&#39;http://schemas.microsoft.com/LiveSearch/2008/04/XML/web&#39;&quot;</span></div>
</li>
</ol>
</div>
<p>The total search result pages is a top level node in the namespace :</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1">&nbsp; &nbsp; Set xmlnode <span class="sy0">=</span> oDoc<span class="sy0">.</span>selectSingleNode<span class="br0">&#40;</span><span class="st0">&quot;//web:Total&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; Debug<span class="sy0">.</span><span class="kw3">Print</span> xmlnode<span class="sy0">.</span>Text</div>
</li>
</ol>
</div>
<p>&#8230;but the good stuff is in the &#8220;WebResult&#8221; nodes in the xml tree, I can use an XPath reference <strong>//web:Webresult</strong> to access that node-collection and with a simple for-next iterate through the collection, selecting the single nodes containing the actual data.</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1">&nbsp; &nbsp; Set oChildren <span class="sy0">=</span> oDoc<span class="sy0">.</span>selectNodes<span class="br0">&#40;</span><span class="st0">&quot;//web:WebResult&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">For</span> <span class="kw3">Each</span> oResult In oChildren</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; Debug<span class="sy0">.</span><span class="kw3">Print</span> oResult<span class="sy0">.</span>selectSingleNode<span class="br0">&#40;</span><span class="st0">&quot;./web:Title&quot;</span><span class="br0">&#41;</span><span class="sy0">.</span>Text</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; Debug<span class="sy0">.</span><span class="kw3">Print</span> oResult<span class="sy0">.</span>selectSingleNode<span class="br0">&#40;</span><span class="st0">&quot;./web:Description&quot;</span><span class="br0">&#41;</span><span class="sy0">.</span>Text</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; Debug<span class="sy0">.</span><span class="kw3">Print</span> oResult<span class="sy0">.</span>selectSingleNode<span class="br0">&#40;</span><span class="st0">&quot;./web:Url&quot;</span><span class="br0">&#41;</span><span class="sy0">.</span>Text</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; Debug<span class="sy0">.</span><span class="kw3">Print</span> oResult<span class="sy0">.</span>selectSingleNode<span class="br0">&#40;</span><span class="st0">&quot;./web:DisplayUrl&quot;</span><span class="br0">&#41;</span><span class="sy0">.</span>Text</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; Debug<span class="sy0">.</span><span class="kw3">Print</span> vbCrLf</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">Next</span></div>
</li>
</ol>
</div>
<p>I output to the Immediate window aka Debug (under <em>V</em>iew, <em>I</em>mmediate Window or Ctrl+G)</p>
<p><a href="http://www.juust.org/wp-content/uploads/2011/12/bing-api-in-vba-visual-basic-for-applications-msaccess-and-excel.png" rel="shadowbox[post-1946];player=img;"><img src="http://www.juust.org/wp-content/uploads/2011/12/bing-api-in-vba-visual-basic-for-applications-msaccess-and-excel.png" alt="" title="bing api in vba visual basic for applications msaccess and excel" width="765" height="248" class="alignnone size-full wp-image-1951" /></a></p>
<p>What can we do with it ? Let&#8217;s make a table for date, keyword, url, title, description, position</p>
<p><a href="http://www.juust.org/wp-content/uploads/2011/12/access-nake-table.png" rel="shadowbox[post-1946];player=img;"><img src="http://www.juust.org/wp-content/uploads/2011/12/access-nake-table.png" alt="" title="access nake table" width="866" height="166" class="alignnone size-full wp-image-1954" /></a></p>
<p>and add some code to store the results we retrieve</p>
<div class="geshi no vb">
<ol>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">Dim</span> table1 <span class="kw1">As</span> DAO.<span class="kw1">Recordset</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">Set</span> table1 = CurrentDb.<span class="me1">OpenRecordset</span><span class="br0">&#40;</span><span class="st0">&quot;Table1&quot;</span>, dbOpenTable<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">&#39;counter for position &nbsp; &nbsp;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; i = <span class="nu0">0</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">Set</span> oChildren = oDoc.<span class="me1">selectNodes</span><span class="br0">&#40;</span><span class="st0">&quot;//web:WebResult&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">For</span> Each oStruct In oChildren</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;i = i + <span class="nu0">1</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">With</span> table1</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span class="me1">AddNew</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">&#39;data from bing</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; !TITLE = oStruct.<span class="me1">selectSingleNode</span><span class="br0">&#40;</span><span class="st0">&quot;./web:Title&quot;</span><span class="br0">&#41;</span>.<span class="me1">Text</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; !Description = oStruct.<span class="me1">selectSingleNode</span><span class="br0">&#40;</span><span class="st0">&quot;./web:Description&quot;</span><span class="br0">&#41;</span>.<span class="me1">Text</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; !url = oStruct.<span class="me1">selectSingleNode</span><span class="br0">&#40;</span><span class="st0">&quot;./web:Url&quot;</span><span class="br0">&#41;</span>.<span class="me1">Text</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">&#39;and some additional data</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; !MYDATE = <span class="kw1">Now</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; !POSITION = i</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; !KEYWORD = MyKeyword</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">&#39;store the record</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span class="me1">Update</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">With</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">Next</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; table1.<span class="kw1">Close</span></div>
</li>
</ol>
</div>
<p>There now that scratches the seo itch :<br />
<a href="http://www.juust.org/wp-content/uploads/2011/12/bing-api-seo-data-in-msaccess.png" rel="shadowbox[post-1946];player=img;"><img src="http://www.juust.org/wp-content/uploads/2011/12/bing-api-seo-data-in-msaccess.png" alt="" title="bing api seo data in msaccess" width="1071" height="224" class="alignnone size-full wp-image-1957" /></a></p>
<p>MsAccess stuff is a bit hard to put on the web as sample, so I&#8217;ll make a quick one in Excel and put it up for download.</p>
<h2>Accessing the Bing Api in Excel VBA</h2>
<p> <a href="http://www.juust.org/wp-content/uploads/file/sample_workbook_vba_bing_api.xlsm">there you go</a> : on sheet 1 you can fill in your AppID and keyword, click the butt(on&#8230;</p>
<p><a href="http://www.juust.org/wp-content/uploads/2011/12/bing-api-in-excel-vba.png" rel="shadowbox[post-1946];player=img;"><img src="http://www.juust.org/wp-content/uploads/2011/12/bing-api-in-excel-vba.png" alt="" title="bing api in excel vba" width="623" height="236" class="alignnone size-full wp-image-1958" /></a></p>
<p>&#8230;and on sheet 2 you get the top 10 search results</p>
<p><a href="http://www.juust.org/wp-content/uploads/2011/12/bing-api-in-excel-vba-sheet2.png" rel="shadowbox[post-1946];player=img;"><img src="http://www.juust.org/wp-content/uploads/2011/12/bing-api-in-excel-vba-sheet2.png" alt="" title="bing api in excel vba sheet2" width="1247" height="304" class="alignnone size-full wp-image-1959" /></a></p>
<p>It uses the cells B1 and B2 as named ranges for MyKeyword and AppID, and has the code in the enclosed module. It also contains one of my AppId&#8217;s so no querying nasty shit, please.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.juust.org/index.php/how-to-get-bing-api-search-results-in-msoffice-vba/2011/12/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>wordpress xmlrpc and microsoft access vba</title>
		<link>http://www.juust.org/index.php/wordpress-xmlrpc-and-microsoft-access-vba/2009/10/</link>
		<comments>http://www.juust.org/index.php/wordpress-xmlrpc-and-microsoft-access-vba/2009/10/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 13:05:25 +0000</pubDate>
		<dc:creator>juust</dc:creator>
				<category><![CDATA[juust]]></category>
		<category><![CDATA[xml-rpc]]></category>
		<category><![CDATA[xhr]]></category>

		<guid isPermaLink="false">http://www.juust.org/?p=972</guid>
		<description><![CDATA[I was building a database in WordPress but their table interface lacks completely and I dont want to spend 200 hours developing a backend for a once-off project. I always used MsAccess for RAD blueprinting and I reckon you can &#8230; <a href="http://www.juust.org/index.php/wordpress-xmlrpc-and-microsoft-access-vba/2009/10/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was building a database in WordPress but their table interface lacks completely and I dont want to spend 200 hours developing a backend for a once-off project. </p>
<p>I always used MsAccess for RAD blueprinting and I reckon you can build a better more flexible interface in 20 hours. With XHR MsAccess has some better internet capabilities these days, a nice simple XMLHttp library. </p>
<p>You can use it for any http rest api in the cloud. </p>
<p>Ajax for Access :) here&#8217;s the most basic wordpress xml-rpc call, sayHello.</p>
<div class="geshi no vb">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">Sub</span> PutXML<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">txtURL = <span class="st0">&quot;http://www.blog.com/xmlrpc.php&quot;</span></div>
</li>
<li class="li1">
<div class="de1">txtUserName = <span class="st0">&quot;user&quot;</span></div>
</li>
<li class="li1">
<div class="de1">txtPassword = <span class="st0">&quot;pwd&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">Dim</span> objSvrHTTP <span class="kw1">As</span> ServerXMLHTTP</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">Dim</span> strT <span class="kw1">As</span> <span class="kw1">String</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">Set</span> objSvrHTTP = <span class="kw1">New</span> ServerXMLHTTP</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; objSvrHTTP.<span class="kw1">Open</span> <span class="st0">&quot;POST&quot;</span>, txtURL, <span class="kw1">False</span>, <span class="kw1">CStr</span><span class="br0">&#40;</span>txtUserName<span class="br0">&#41;</span>, _</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="kw1">CStr</span><span class="br0">&#40;</span>txtPassword<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; objSvrHTTP.<span class="me1">setRequestHeader</span> <span class="st0">&quot;Accept&quot;</span>, <span class="st0">&quot;application/xml&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; objSvrHTTP.<span class="me1">setRequestHeader</span> <span class="st0">&quot;Content-Type&quot;</span>, <span class="st0">&quot;application/xml&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; strT = <span class="st0">&quot;&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; strT = strT &amp; <span class="st0">&quot;&lt;methodcall&gt;&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; strT = strT &amp; <span class="st0">&quot;&lt;methodname&gt;demo.sayHello&lt;/methodname&gt;&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; strT = strT &amp; <span class="st0">&quot;&lt;/methodcall&gt;&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; objSvrHTTP.<span class="me1">send</span> strT</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">MsgBox</span> objSvrHTTP.<span class="me1">responseText</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">End</span> <span class="kw1">Sub</span></div>
</li>
</ol>
</div>
<p>For pre-Vista you need the MSXML 6.0 library from microsoft, in Vista I already had it installed so you can add a reference to the library and off you go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.juust.org/index.php/wordpress-xmlrpc-and-microsoft-access-vba/2009/10/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

