Documente online.
Zona de administrare documente. Fisierele tale
Am uitat parola x Creaza cont nou
 HomeExploreaza
upload
Upload




ATLRT Sample: Demonstrates ATL Server Web Applications

computers


ATLRT Sample: Demonstrates ATL Server Web Applications

(the following is the download text. UE will do the download text)

Click to open or copy the SampleName project files.
mfc\general\SampleName
mfc\general\SampleName



ATLRT is an ATL Server request handler that exposes a set of 'generic' tags. These tags can be used to build ATL Server applications. This sample illustrates database access using OLE DB consumer templates as well as how ATL Server tags can be used to create a virtual 'scripting language'. The ATLRT tags are:

Tag Name

Description

}

GetValue will be replaced by the value of the variable specified by 'name'. GetValue will look for variables in the following order:

variable map

request variables (POST and GET)

server variables

Variables can be stored in the variable map by using the database operations. Request variables are set by form submissions. Server variables are set on every request of a .srf file.

}

CopyValue copies the value of the variable specified by 'source variable' into the variable map entry specified by 'new variable'. Values are obtained for the variable specified by 'source variable' in the same manner as GetValue. This tag has no replacement value.

}

Very similar to GetValue, except that it checks for the existence of the v 21221r1710v ariable specified by 'name'. ContainsValue has no replacement value, but it will return true or false, depending on whether name exists or not. ContainsValue should be used in an } statement.

}

Compares the value of the variable specified by 'name' with the literal value specified by 'value'. CompareValue will return a true or false depending on whether the values are equal. CompareValue has no replacement value and should be used in an } statement.

}

MaintainValue stores the specified variable into a hidden input field with the

same name as the variable. For example, } would be replaced by (assuming the value of 'testing' is 'hello world':

<input type="hidden" name="testing" value="hello world">

You can also name the hidden field by using } This would generate:

<input type="hidden" name="testing2" value="hello world">

}

SetConnection is used to store a connection string. The Execute tag to connect to data sources will use these connection strings. You can use multiple connection strings on a page by specifying the 'name' attribute. If you don't specify a 'name' attribute, then the connection string is stored using a default name.

}

SetConnection must be called before calling Execute. Execute executes a stored procedure. The following is a description of the parameters that Execute can accept:

'cmd' parameter is the only required parameter; it is used to specify the stored procedure name.

'conn' can be used to specify the name of the connection string to use. If it isn't specified, then the connection string stored at the default name is used.

'results' is optional, it is used to store the results of the stored procedure by name. The rest of the database operation tags will manipulate these results. If 'results' is not specified, then any results of the stored procedure will be stored by a default name. Specifying more than one value for 'results' implies that the stored procedure will return multiple results.

'params' is used to pass parameters to the stored procedures. Parameters values are take from the same places as } or are used as literal values, if surrounded by single quotes. For example, if params is specified as follows:

params=name, 'testing'

'name' would be considered a variable, and its value would be resolved from the same places as } (variable map, request parameters, server variables). 'testing' is surrounded by single quotes, so it's literal value will be passed to the stored procedure.

'output_params' are use to name any output parameters that the stored procedure my return. The values will be stored in the variable map.

}

Execute has to be called before calling MoveNextRow. Results from executing a stored procedure are stored in tables. MoveNextRow advances the current row in the table. 'result name' is an optional parameter specifying what result to advance. MoveNextRow has no replacement value, but it will return boolean depending on whether there are more rows in the results or not. MoveNextRow should be used in a } or } statement.

}

Execute has to be called before calling MoveNextColumn. MoveNextColumn moves over the column values stored in the results of executing a stored procedure. 'result name' is an optional parameter specifying what column to advance. MoveNextColumn has no replacement value, but it will return boolean depending on whether there are more columns in the current row or not. MoveNextColumn should be used in a } or } statement.

}

Execute has to be called before calling GetColumnValue. GetColumnValue is used to get the value of a specific column from a set of results. The parameters to GetColumnValue determine which column is used. The following are the possible ways to call GetColumnValue:

}

o        Use the default result name and the current column value stored for that result.

}

o        Use the specified result name and the current value stored for that result

}

o        Use the specified result name and the specified column value.

}

o        Use the default result name and the specified column value

}

Execute has to be called before calling SaveColumnValue. SaveColumnValue is similiar to GetColumnValue except that it will store the specified column value into the variable map. The following are the possible ways to call SaveColumnValue:

}

o        Use the result specified by 'result name' and the column specified by 'column index'and save that value into the variable map under the name 'save as name'.

}

o        Use the result specified by 'result name' and the column specified by 'column index' and save the value into the variable map under the name 'result name'

}

o        Use the default result name, current column and save that value into the variable map under the default result name

}

o        Use the default result name, the current column and save that value into the variable map under the name specified by 'save as name

}

o        Use the default result name, the column specified by 'column index' and save that value into

o        the variable map under the name specified by 'save as name'.

}

Execute has to be called before calling GetRowNumber. The row number of the current row replaces GetRowNumber. 'result name' is optional and can be used to specify the result from which to get the row number. The default result name is used if this parameter is not specified.

}

Execute has to be called before calling GetColumnNumber. The column number of the current column replaces GetColumnNumber. 'result name' is optional and can be used to specify the result from which to get the column number. The default result name is used if this parameter is not specified.

}

Execute has to be called before calling ResetResults. ResetResults is used to reset the current row and column number of a result. 'result name' can be used to specify the result. The default name is used if this parameter is not specified.

}

Execute has to be called before calling CloseResults. CloseResults is used to erase the values of a result. 'result name' can be used to specify the result. The default name is used if this parameter is not specified.

}

Execute has to be called before calling RowCount. The number of rows in a result replaces RowCount. 'result name' can be used to specify the result. The default name is used if this parameter is not specified.

This sample requires the following:

SQL Server 7.0+ database and tools

o        And permission to create databases.

Visual Studio.NET C++ compiler and libraries

IIS 5.0+

o        And permission to create virtual directories.

Note, all of the above except IIS and SQL Server are installed with Visual Studio .NET

Building and Running the Sample

Setting up the database

a.      Open the Query Analyzer tool and connect to your SQL Server database server.

b.      Open the sample file atlrt.sql in Query Analyzer.

c.      Run this file to create the database tables, views, and stored procedures.

Changing the connection string

a.      Open atlrt.srf

b.      Change the value in } to reflect your server name, user name, and password.

Building ATLRT

a.      Open atlrt.vcproj in Visual Studio .NET and build

Installing ATLRT

a.      Create a virtual directory

b.      Copy atlrt.dll to the physical location of your virtual directory

c.      Create an application in your virtual directory

d.      Register atlrt.dll as the .srf handler for this application

e.      Copy atlrt.srf into your virtual directory

i. atlrt.srf is just an illustration of how the tags in atlrt.dll can be used.

This sample demonstrates the following keywords:

ATLServer;ISAPI;OLEDB;SRF


Document Info


Accesari: 1312
Apreciat: hand-up

Comenteaza documentul:

Nu esti inregistrat
Trebuie sa fii utilizator inregistrat pentru a putea comenta


Creaza cont nou

A fost util?

Daca documentul a fost util si crezi ca merita
sa adaugi un link catre el la tine in site


in pagina web a site-ului tau.




eCoduri.com - coduri postale, contabile, CAEN sau bancare

Politica de confidentialitate | Termenii si conditii de utilizare




Copyright © Contact (SCRIGROUP Int. 2024 )