Project: ASP.NET Flash Banner Statistics Script
July 27, 2006 – 4:22 pmProject: ASP.NET Flash Banner stats script
Language Used: ASP.NET, SQL
Database: SQL
Time to Complete: 4 days
For this project we worked with Trae Regan of ThinkAble.com who contacted us to complete a script that would allow and collect statistics for Flash Banners.
We used a DSN connection to connect from the script to the database. DSN simply stands for Data Source Name. The point of setting this up is to access a data source on a remote server (i.e. If your site is hosted on a web server other then your own). Check out the following snippet of code to see how this is done…
< %
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=myCONNECTION.dsn"
objConn.Open
%>
If you were going to connect locally, assuming your web server is a local server you’d simply use the following…
< %
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("/mydatabase.mdb") & ";"
objConn.Open
%>
The only difference is mapping to a data source locally (DNS-less) or remotely (DNS).
Now that we are finished with that brief tutorial of DSN / DSN-less connections we’ll get back to the rest of what was covered by this project. Lastly the results of the banner clicks are saved to the SQL database and displayed in an ASP.NET web script that will track the number of clicks on a particular flash banner. Trae Regan had this to say about working with CommerceCubes…
“Lucas is a great communicator, and efficient programmer. Thank you” - Trae Regan