A banner Management class program (translation)

Source: Internet
Author: User
Tags dsn include
How the program is called
1.. Banner (Width, Height)
. The banner method is used to tell the banner management program what size of banner you want to display on the client.
I. Width: <banner width >
Ii. Height: <banner height >
2.. Click (banner_id, Banner_url)
This method is rarely used by programmers. It is useful to use at the client click Banner Statistics
I. banner_id: < Banner the number >
II. Banner_url: <banner linked URLs, such as:bannermaster.asp?id=1&url=www.banneryouselected.com>

Create a database named Bannermaster or <a href= "Http://asp-code.aspsamples.com/fpdb/BannerMaster.mdb" >Download</a>
Add the following column to the new database
"banner_id [1...2...3 ...] Int Don "t allow NULLs and Check Identity Seed 1
"Banner_vendor [ex Monster.com] Varchar Allow NULLs
"Banner_width [ex 468] int AllowNulls
"Banner_height [ex] int allownulls
"Banner_alt [ex Monster Job Search] Varchar allownulls
"Banner_url [ex www.monster.com] Varchar allownulls
"Banner_file [ex monster_logo-1.gif] Varchar allownulls
"Banner_path [ex images/ads/] Varchar allownulls
"Banner_imp_purchased [ex 10000] Varchar allownulls Default 1000
"Banner_imp_current [ex 2343] Varchar allownulls Default 1
"Banner_imp_total [ex 120034] Varchar allownulls Default 1
"Banner_ct_current [ex] Varchar allownulls Default 1
"Banner_ct_total [ex 1200] Varchar allownulls Default 1
"Banner_ct_percent [ex 1.01] Varchar allownulls Default 0
"Banner_account_active [ex True] Varchar allownulls Default True

Add banner to the database.
Create a file named Bannermaster.asp with the following code:

<!--#include virtual= "bannermastertestclass.asp"-->
<%
Dim Banner_url
Dim banner_id
Banner_url = Request ("B")
banner_id = Request ("ID")
Call BM. Click (banner_id, Banner_url)
Response.Redirect "http://" & Banner_url
%>

Create a include file named Bannermastertestclass.asp with the following code:
<%
"*******************************************************************************
The Open database
"*******************************************************************************
"Define Connection Data variables
Dim server_ip
Dim database_name
Dim table_name
Dim user_name
Dim Password

SERVER_IP = "xx.xx.xx.xx"
database_name = "Banner_database"
table_name = "Banner_master"
user_name = "Logon_name"
Password = "User_password"


Set dbconnection = Server.CreateObject ("Adodb.connection")
DSN = "Driver={microsoft Access DRIVER (*.mdb)};"
DSN = DSN & "dbq=" & Server.MapPath ("Bannermaster.mdb")
DSN = DSN & "; Uid= "&User_Name&"; Pwd= "&password
Dbconnection.open DSN


"*******************************************************************************
The Create Class
"*******************************************************************************
Class Bannermasterclass
Public error_trapping_on
Public Sql_debug
Public Bannerarray "Avb outside of function
Public number_of_banners

"*******************************************************************************

"*******************************************************************************
class to initialize the
"*******************************************************************************
Private Sub Class_Initialize ()
If Sql_debug = True Then
Response.Write "Defaults Set <br>"
End If
End Sub

"*******************************************************************************
"Banner Master
"*******************************************************************************
Public Function Banner (Banner_width, Banner_height)
If error_trapping_on <> False Then on Error Resume Next
If Sql_debug = True Then Response.Write "<br>function Banner called<br><br>"
If banner_width = "" OR banner_height = "" Then
If Sql_debug = True Then Response.Write "You must specify a Banner Width and Height <br>"
Banner = "Banner Width and Height<br>"
Exit Function
End If

"*******************************************************************************
"Create a fixed size activity banners
&qu



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.