Super-simple flash asp access Counter

Related Tags:

  Although the counter does not necessarily use the database, but I really counter this very, very simple 

  Guoy_8186 is subject to the most inspired, he will vote Guide really very good. 

  Flash code: 

  Var count = new LoadVars (); / / create an object loadVars 
  Count.load ( "Your Path / write.asp", count); / / asp document reader 
  Count.onLoad = function (success) ( 
  If (success) ( 
  = Count.total visits; 
  ) / / Determine whether the above is finished reading, after the completion of the variables to read scenes in the variable 
  ); Asp code: 
<%
  Dim rs 
  Dim sql 
  Dim conn 'definition of variables 
  Set rs = server.createobject ( "adodb.recordset") 'to create data sets targets 
  Conn = "DBQ =" server.mappath ( "counter.mdb") "; DefaultDir =; DRIVER = (Microsoft Access Driver (*. mdb));" 'database connection statement, the default is the root directory of your space, if the database document folder path ahead to add to 
  Sql = "update count set num = num 1 where id = 1" 'to the num this value plus a phrase 
  Rs.open sql, conn, 1,1 'implementation of write 
  Sql2 = "select * from count where id = 1" 'read the statement 
  Rs.open sql2, conn, 1,1 'implementation of reading 
  If not rs.eof then 
  Total = rs ( "num") 'the value of the database to a variable 
  Response.write "& total =" total & & "&" 'data can be read into the form of flash 
  Else 
  End if 
  Set rs = nothing 
  Set conn = nothing 
%>

  Use database access, building a database called counter, inside the building of a new table called count, table inside only need to create two fields, one called id, type automatic election code, the main button settings; Another called num, type figures , the data storage field is the place. 

  This OK!    Each subsequent flash open this document in the database will be increased by 1, to read because there is a flash variables, you can deal with it as it pleases.    Attached to the source code download: Click here to download the source files 

Related articles:

CSS style sheets in the div, and the center span elements
  <div> And <span> be used for the specified style or content bundled scripts.    Although most HTML element can be set up through the style attributes style information, but many HTML element has its own default format, style and the style may be the definition of mixed ...
In Dreamweaver easily folded sliding menu
  This paper prepared by the studio from 4 u2v "Dreamweaver Web design and produce 100 cases" (Telecom Publishing House, ISBN: 7115142394).    Without the written authorization of the copyright owners permission to reproduce this prohibition.    Buy address: Clic...
Flash ActionScript Learning: getURL function of the use of the Guide
  First statement is not original, as it was found to frequently asked friends on this issue, I saw this article a more detailed presentation on the mind, we would like to help, if that will support a good……    Since it is a network animation, FLASH animation and the "hyperlink...
China seo industry breakthrough in the current need several issues
  When SEO abroad has been made sound development of the domestic seo from many staff members felt puzzled why China's search engine optimization industry market is not so ideal? This is a very broad topic and, if this problem can be resolved in the Our search engine optimization prospects...
FLASH ActionScript Learning: Parity judge several ways
  OnMouseDown = function () (    Var n = (i =! I)? "Odd": "even";    Tap Bujingyun)    I = true;    OnMouseDown = function () (    I =! I;    If (i == false) (n = "odd";) else (n = "even";)...