Here is the code I used to interact with our MS SQL Servers and MS Access DBs. This can also be used with anything that has VBA. ie Word, Excel, PowerPoint. I tried to comment as thourghly as I could to help other people adapt this to their environment.
This currently works for me in a MS Office 2003 SP2 Environment, using DekiWiki 1.8.3 via the VM. I do not have the means to test this on other environments, but it should work as long as IE is installed on your computer.
Let me point out that I am not a programmer by nature, just an all around IT guy. This code could and should be rewritten to make it more efficient. I just got this to a working point to import our data. (We run this weekly)
You will need the following information:
myPage = The name of the page you want to create, case sensitive. ex: AAAAAA
myPath = The path you want the page in, with trailing /. ex: Test/
pageText= The html body of your page. ex: Testing 123 or a variable like strHTML
myServer= The server name you want to post to w/o http:. ex: myserver.com or 10.1.1.1
myUser= The user name you want to use to create the page. ex Test.User
myPassword= The password for the above user. ex TestPassword
Then just call the function like below using the examples above.
This will return a string to strStatus with the status information:
strStauts = mypostSite("AAAAA", "Test/", "10.1.1.1", strHTML, "Test.User", "TestPassword")
Or just use this to return nothing:
mypostSite "AAAAA", "Test/", "10.1.1.1", strHTML, "Test.User", "TestPassword"
I have attached two text files.
1. Post Functions.txt The function itself to upload a file to your wiki
2. CreateHTML.txt Is a sample that loops through a table called tblServers, and posts each record to the wiki in formated HTML.
| File | Size | Date | Attached by | |||
|---|---|---|---|---|---|---|
| CreateHTML.txt Preview No description | 2.91 kB | 01:55, 22 Feb 2008 | icepick | Actions | ||
| Post Functions.txt Preview No description | 3.22 kB | 01:55, 22 Feb 2008 | icepick | Actions | ||