-
function open conn() defines the function open conndim dbpath, and conn defines the variables dbpath and conndbpath="Database path"Override the relative path of your database to the variable dbpath
set conn="") defines the use of connection objects to join databases.
The path to open the join database is"Database path"provider, which is the connection to your default data manager name.
set open conn=conn to set the wrong index.
if err then to determine if there is an error, and if so.
Clear the contents of the wrong object.
set conn=nothing closes the database.
Sorry, there was an error with the database connection. "Misentered the statement.
End the asp statement exits.
end if judgment ends.
end function function.
-
function open_conn()
Declare database paths, and database connection variables.
dim dbpath,conn
Obtain the database file path on the server.
dbpath="Database path")
Create an ADO database connection object.
set conn="")
Open the database.
Assign open database connections to the open conn variable set open conn=conn
Here's how to handle an error, if you get an error when opening the database, handle it here.
if err then
Clear the error message.
Close the database connection to release the resources it occupies.
set conn=nothing
Output on a web page"Sorry, there was an error with the database connection. "
Sorry, there was an error with the database connection. "
Stop the parsed page below and send the content of the web page that has been parsed so far to the customer.
end if
The end of the function. end function
-
This is a function of asp to open the data access database, function open conn().
dim dbpath,conn
dbpath="Database path"This is the path to open the database, where the relative path is converted to an absolute path, and its usage is as follows: under d: access d
d:\access\d\"")
But make sure that the ASP document is under d: access d.
set conn="")
This is to create a data connection.
This is to use the open method of conn to open the database, the source is to point to the database, and the provider is to provide the driver to open the database, and you can use other drivers.
set open conn=conn so that open conn equals open
The following is to use the error object to check whether it is opened, if you don't open err, it is not equal to 0, and if you don't open it, it will become non-0
if err then
Clear the error. set conn=nothing closes the conn object.
Sorry, there was an error with the database connection. "
end if
end function
If there's anything you don't understand, I can give you information if you want.
-
ASP is an abbreviation for Active Server Page, which means "dynamic server page". ASP is an application developed by Microsoft to replace CGI scripting programs, which can interact with databases and other programs, and is a simple and convenient programming tool. The format of the asp web page file is:
ASP is now commonly used in a variety of dynamics. In addition, the abbreviations of aspirin, aspartic acid, Ali Software sales partners, and the American Armed Systems and Programs Company are also ASPs.
Name. ASP: English name: Active Server Pageasp
asp。English name: The American Society of Pharmacognosy The most influential American Society of Biochemical Medicine in the world.
do while not
Output line. for i=1 to 3 >>>More
If you have a problem, you post all of it, or send it to me to help you modify it. >>>More
Hehe, this is the most common problem that every ASP programmer encounters, and it is also the most overlooked. >>>More
First of all: it is used to save the file, not to determine which directory to upload to. >>>More
What you mean is that you have to jump to the past, and you can't jump to any other page. >>>More