December 12th, 2007

How to create XML from an Access (mdb) database with ASP

OK, so I recently created this code with VBS, but it would work with ASP as well. Basically, you need to place the script in a folder where it can get write permissions to create the XML file. Then you'll connect to the Access database like you would normally. Although to be perfectly honest, you could use this script to create an XML from data in just about any type of database that you can connect to!

'=== declare variables
Dim objConn, strConnect, strSQL, rs, tb, mdbFile, objFSO, xmlFile, objWrite

'=== filename variables
xmlFile = Server.MapPath(""inventory.xml")
mdbFile = Server.MapPath("
database.mdb")

'=== tab character for xml file
tb = chr(9)

'=== instantiate objects
set objFSO  = Server.CreateObject( "Scripting.FileSystemObject" )
Set objConn = Server.CreateObject( "
ADODB.Connection" )

'=== connect to database
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & mdbFile

'=== open/create xml file
If Not objFSO.FileExists( xmlFile ) Then objFSO.CreateTextFile( xmlFile )
set objWrite = objFSO.OpenTextFile( xmlFile, 2 )

'=== open the xml file
objWrite.WriteLine("<?xml version=""1.0"" encoding=""ISO-8859-1""?>")
objWrite.WriteLine("
<data>")

strSQL = "SELECT * FROM table WHERE 1=1"
Set rs = objConn.Execute(StrSQL)

'=== loop through results
Do While not rs.EOF
    objWrite.WriteLine(tb & "<item>")
    objWrite.WriteLine(tb & tb & "
<id>" & rs("id") & "</id>")
    objWrite.WriteLine(tb & tb & "
<product>" & replace(rs("product"),"&","&amp;") & "</product>")
    objWrite.WriteLine(tb & tb & "
<color>" & rs("color") & "</color>")
    objWrite.WriteLine(tb & tb & "
<size>" & rs("size") & "</size>")
    objWrite.WriteLine(tb & "
</item>")
    rs.MoveNext
Loop

'=== finish xml file
objWrite.WriteLine("</data>")
objWrite.Close()

November 21st, 2007

Where to get written term papers

Now, I don't condone cheating in any way. However, I recognize the advantage of being able to 'leverage' the creative power of others to be able to produce something even better. So, if you're faced with the task of writing term papers in the near future, it would be good to have a good reference source.

So I found a great resource for you to access term papers written in the past. There are literally thousands, on almost any subject! Click here to check them out!

November 21st, 2007

How to add nofollow to wordpress blogroll links

So I recently discovered that my site had dropped for PageRank 5 to a PageRank 3. I looked into it, and I still have lots of links coming to my site. It appears that I was penalized by Google, and it seems to be because I had some paid links on my homepage. So, I decided to add rel="nofollow" to the links. The only problem is that when you try to do this with the Blogroll editor in WordPress, there is no nofollow option. So I had to add one.

If you wish to do the same, it's quite easy. Just find the /wp-admin/edit-link-form.php file, create a backup copy of it, and modify it. Look for lines 113 and 114, which should look like:

<tr>
        <th scope="row"> <?php _e('identity') ?> </th>

And add this code before it:

<tr>
        <th scope="row"> nofollow </th>
        <td>
                <label for="nofo">
                <input class="valinp" type="checkbox" name="nofo" value="nofollow" id="nofo" <?php xfn_check('nofo', 'nofollow'); ?> />
                nofollow</label>
        </td>
</tr>

You'll now be able to edit your blogroll links and add rel="nofollow" to any you wish.

November 21st, 2007

Play Flash Hero online for free

OK, so one of you awesome students requested "Flash Hero" as a flash game on my site. Ive never played it before, but it looks cool, so I'll go ahead and add it.
(more…)

November 13th, 2007

Sorry for the down-time

Looks like my site was down for a couple of hours today. I apologize for the loss of any gaming time you may have experienced! It seems the site is getting to popular, and it was using too many hosting resources. I've implemented a caching plugin, so hopefully that fixes the issue.

I also apologize for the lack of posting in the last few days. I guess I really just don't know where to go with this blog. I don't know what sorts of new content people want to see and read. Do you just want me to keep posting games?

« Previous PageNext Page »