1. How to determine your site Asp virtual physical path

A: The method used Mappath


The Physical path to this virtual website is:


< % = Server.MapPath ("")%>

2. I used to know the user's browser
A: Use the Request object method
strBrowser = Request.ServerVariables (”HTTP_USER_AGENT”)
If Instr (strBrowser, “MSIE”) <> 0 Then
Response.redirect (”ForMSIEOnly.htm”)
Else
Response.redirect (”ForAll.htm”)
End If

3. How to calculate the average daily number of repeated visits
A: The solution
< % Startdate = DateDiff ("d", Now, "01/01/1990")
if strdate <0 then startdate = startdate *- 1
avgvpd = Int ((usercnt) / startdate)%>

Show Results
< % Response.write (avgvpd)%>
that is it.this page have been viewed since November 10,1998

4. How to display random images
< % Dim p, ppic, dpic
ppic = 12
randomize
p = Int ((ppic * rnd) +1)
dpic = “graphix / randompics /” & p & “. gif”
%>

Show
“> preivous page

Or use the image such as:
<% = request.serverVariables (“>

6. How to determine each other's IP address
A: < % = Request.serverVariables ("REMOTE_ADDR)%>

7. How to link to a picture
A: < % @ Languages = vbs cript%>
< % Response.expires = 0
strimagename = “graphix / errors / erroriamge.gif”
response.redirect (strimagename)
%>

8. Forced to enter a password dialog box
A: The release contained this statement at the beginning of the page
< % Response.status = "401 not Authorized"
response.end
%>
9. How to pass variables from one page to another
A: pass variable with the type HIDDEN
< % Form method = "post" action = "mynextpage.asp">
< % For each item in request.form%>

< % S cript language ='''' javas cript''''>
alert (”< % = yourvar%>“)

11. There is no way to protect their source code, not people to see
A: You can download a Microsoft Windows s cript Encoder, it can asp script and client javas cript / vbs cript script encryption.

12. How can the query string asp file transfer from one to another
A: The former file by adding the following sentence:
Response.Redirect (”second.asp?” & Request.ServerVariables (”QUERY_STRING”))

13.global.asa file does not work always
A: Only web directory is set to web application, global.asa to be effective, and a web application's root directory global.asa to be effective. IIS Internet Service Manager can be used to set application setting how to make the same htm file as asp file can execute script code?

14. How can we make the same htm file as asp file can execute script code
A: Internet Sevices Manager -> select the default web site -> Right mouse button -> menu properties -> home directory -> Application Settings (Application Setting) -> click the button “Configure” -> app mapping -> click the button “Add” -> executable browse options WINNTSYSTEM32INETSRVASP.DLL EXTENSION input htm method exclusions can enter PUT.DELETE all OK. However, noteworthy is also the asp.dll deal on htm, efficiency will be reduced.

15. How to register components
A: There are two ways.

The first method: manual registration DLL IIs have been using this method and other Web Server. It requires you down in the command line execution, access to the directory that contains a DLL and type: regsvr32 component_name.dll such as c: tempregsvr32 AspEmail.dll it will register dll into the server-specific information in the registry. Then this component can be used on the server, but this method has a drawback. When using this method to register after the completion of components, the component must be appropriate to set NT permissions to the anonymous account with the implementation of the dll. In particular, some components need to read the registry, so this method of registration of components is to use only the server is not the case of MTS, to unregister the dll, use: regsvr32 / u aspobject.dll example c: tempregsvr32 / u aneiodbc.dll

The second method: using the MTS (Microsoft Transaction Server) MTS allows you to specify that only privileged users can access components, which greatly improved the web server security settings. Registered in the MTS component as follows:
1) Open the IIS management console.
2) to start transaction server, right-click “pkgs installed” and then select the “new package”.
3) Click “create an empty package”.
4) to the package name.
5) Specify the administrator account or the use of “interactive” (often used if the server administrator, then login).
6) Now use the right-click the package you just created to start the following after the “components”. Select “new then component”.
7) Select the “install new component” [b].
8) to find you. Dll file and then select the next to finish.
To delete this object, simply select its icon, then choose delete.
Note: particular attention to the second method, which is used to debug the best way to write your own components, without having to restart each time the machine was.

[Next]

16. ASP and Access database connection:
< % @ Language = VBs cript%>
< %
dim conn, mdbfile
mdbfile = server.mappath (”database name. mdb”)
set conn = server.createobject (”adodb.connection”)
conn.open “driver = (microsoft access driver (*. mdb)); uid = admin; pwd = database password; dbq =” & mdbfile
%>

17. ASP and SQL database connection:
< % @ Language = VBs cript%>
< %
dim conn
set conn = server.createobject (”ADODB.connection”)
con.open “PROVIDER = SQLOLEDB; DATA SOURCE = SQL server name or IP address; UID = sa; PWD = database password; DATABASE = database name
%>

The establishment of the Recordset object:
set rs = server.createobject (”adodb.recordset”)
rs.open SQL statement, conn, 3,2

18. SQL common commands to use:

(1) data record selection:
sql = “select backup bin bin_old conf config crawler.tar.gz crawler_bin.tar.gz data eshow eshow_sitemap.html generate.sh google.html google.html.md5 log maint news: 10 news: 11 news: 12 news: 13 news: 14 news: 15 news: 16 news: 17 news: 18 news: 2 news: 3 news: 4 news: 5 news: 6 news: 7 news: 8 news: 9 outboundLinksMgr.sql seeds sitemap.html svn tasks tmp xml2dict -2008.6-tar.gz xml2dict-read-only from the data table where the field name = field value order by field name [desc] “

sql = “select backup bin bin_old conf config crawler.tar.gz crawler_bin.tar.gz data eshow eshow_sitemap.html generate.sh google.html google.html.md5 log maint news: 10 news: 11 news: 12 news: 13 news: 14 news: 15 news: 16 news: 17 news: 18 news: 2 news: 3 news: 4 news: 5 news: 6 news: 7 news: 8 news: 9 outboundLinksMgr.sql seeds sitemap.html svn tasks tmp xml2dict -2008.6-tar.gz xml2dict-read-only from the data table where field names like''''% field values %'''' order by field name [desc] “

sql = “select top 10 backup bin bin_old conf config crawler.tar.gz crawler_bin.tar.gz data eshow eshow_sitemap.html generate.sh google.html google.html.md5 log maint news: 10 news: 11 news: 12 news : 13 news: 14 news: 15 news: 16 news: 17 news: 18 news: 2 news: 3 news: 4 news: 5 news: 6 news: 7 news: 8 news: 9 outboundLinksMgr.sql seeds sitemap.html svn tasks tmp xml2dict-2008.6-tar.gz xml2dict-read-only from the data table where the field name order by field name [desc] “

sql = “select backup bin bin_old conf config crawler.tar.gz crawler_bin.tar.gz data eshow eshow_sitemap.html generate.sh google.html google.html.md5 log maint news: 10 news: 11 news: 12 news: 13 news: 14 news: 15 news: 16 news: 17 news: 18 news: 2 news: 3 news: 4 news: 5 news: 6 news: 7 news: 8 news: 9 outboundLinksMgr.sql seeds sitemap.html svn tasks tmp xml2dict -2008.6-tar.gz xml2dict-read-only from the data table where the value of a field name in ('''''''','''' value 2 value 3'''','''''' '') “

sql = “select backup bin bin_old conf config crawler.tar.gz crawler_bin.tar.gz data eshow eshow_sitemap.html generate.sh google.html google.html.md5 log maint news: 10 news: 11 news: 12 news: 13 news: 14 news: 15 news: 16 news: 17 news: 18 news: 2 news: 3 news: 4 news: 5 news: 6 news: 7 news: 8 news: 9 outboundLinksMgr.sql seeds sitemap.html svn tasks tmp xml2dict -2008.6-tar.gz xml2dict-read-only from the data field names between tables where values of 1 and value 2 “

(2) update the data record:
sql = “update table set field name = field value where the conditional expression”

sql = “update table set field 1 = value 1, field 2 = value 2 … … field n where n = the value of conditional expression”

(3) Delete data record:
sql = “delete from table where conditions of expression”

sql = “delete from table” (delete all records data table)

(4) to add data records:
sql = “insert into table (field 1, field 2, field 3 …) valuess (value 1, value 2, value 3 …)”

sql = “insert into the target data table select backup bin bin_old conf config crawler.tar.gz crawler_bin.tar.gz data eshow eshow_sitemap.html generate.sh google.html google.html.md5 log maint news: 10 news: 11 news : 12 news: 13 news: 14 news: 15 news: 16 news: 17 news: 18 news: 2 news: 3 news: 4 news: 5 news: 6 news: 7 news: 8 news: 9 outboundLinksMgr.sql seeds sitemap. html svn tasks tmp xml2dict-2008.6-tar.gz xml2dict-read-only from the source data sheet “(the source data table records to the target data table)

(5) data recording Statistical Functions:
AVG (field names) come to mean a table column
COUNT (* | field names) on the statistical data the number of rows or columns have the value of a number of rows of data statistics
MAX (field names) to obtain the maximum value of a table column
MIN (field names) to obtain the minimum value of a table column
SUM (field names) to add the value data field

Applying the above function method:
sql = “select sum (field name) as an alias from table where conditions of expression”
set rs = conn.excute (sql)

With rs (”Alias”) to obtain the total value system, and other functions using Ibid.

Table creation and deletion:
CREATE TABLE table name (field 1 type 1 (length), field 2 type 2 (length) … …)

Example:
CREATE TABLE tab01 (name varchar (50), datetime default now ())

DROP TABLE table name
(Permanently delete a data table)

19. Recordset object's methods:

rs.movenext the record pointer to move down from the current location line

rs.moveprevious record pointer will move up from the current location line

rs.movefirst the record pointer to the first row of table

rs.movelast the record pointer to the last line of table

rs.absoluteposition = N the record pointer to move the first N rows of data table

rs.absolutepage = N the record pointer to move the first page of the first line of N

rs.pagesize = N set to N records per page

rs.pagecount pagesize set according to the total number of pages returned

rs.recordcount the total number of returned records

rs.bof whether the record pointer back to the first side than the data table, true representation is, false to any

rs.eof return to the record pointer is beyond the data sheet at the end, true representation is, false to any

rs.delete delete the current record, but the record pointer does not move down

rs.addnew add records to the data table at the end

rs.update update data table records

20 Recordset object methods

Open method

recordset.Open Source, ActiveConnection, CursorType, LockType, Options

Source
Recordset objects can be connected through the Source property to Command object. Source parameter can be a Command object name, a SQL command, a specified table name or a Stored Procedure. If this parameter is omitted, the system is using Recordset object's Source property.

ActiveConnection
Recordset objects can be connected through the Connection object ActiveConnection property. ActiveConnection here can be a Connection object or a string containing the database connection information (ConnectionString) string parameter.

CursorType
CursorType Recordset object Open method parameter that will start what kind of cursor type data, including adOpenForwardOnly, adOpenKeyset, adOpenDynamic and adOpenStatic, are as follows:

Constant
Constants
Description adOpenForwardOnly
0
Default values, start a cursor can only move forward (Forward Only) adOpenKeyset
1
Start a Keyset cursor type adOpenDynamic
2
Start a Dynamic adOpenStatic cursor type
3
Start a Static cursor type

Several cursor over the type Recordset object will directly affect all of the properties and methods, the following list shows the difference between them.

Recordset property
NextRecordset method which does not apply to Microsoft Access database.

LockType
Recordset object Open method parameter that should be used LockType Lock type, if this parameter is ignored, then the system will LockType property Recordset object to the default value. LockType??????adLockReadOnly??dLockPrssimistic??dLockOptimistic??dLockBatchOptimistic???????????br />

???
?????br />???adLockReadOnly
1
??????Recordset?????????????????????AddNew??pdate??elete?????dLockPrssimistic
2
??????????????????????????????????????????????????dLockOptimistic
3
??????????????????????????????????????????????????????????????????adLockBatchOptimistic
4
??????????????????????????ursorLocation??????adUdeClientBatch???????????????????????

????:

DVR-MS To MPG

CAD world, Shangri-La

evaluation Helpdesk AND Remote PC

The new VPN strength

Specialist Install And Setup

how to sync iphone ringtone on mac

2007, the Chinese simulation years

The “job” into a “job search” strategy

Flash to MPEG

Joint Commerce and Industry of India: India will rely heavily on computer hardware in China

New Class is THE Blue Ocean

SWF to MP4

Foam Everywhere

Geology of gold abacus help more Cattle supplies Ox

Huang Ching-agents accused of switching CPU is not placed on file