Recommended: Introduction to Asp and five built-in objects Table 1. ASP Basics 2. Five major objects of ASP 3. Request object 4. Response object 5. Server object 6. Application object 7. Session object 1. ASP Basics Microsoft Active Server Pages, which readers and friends call it
Operations related to databases are often used. It includes connection codes, SQL commands, etc., but I have never deliberately remembered them (I don’t want to remember this thing), so I often check the books and flip through them when I use them. Some less used databases may not be found smoothly, so now I will summarize them here for your reference.
<1> database connection method :
1. DSN-less connection method of Access database:
| The following is the quoted content: set adocon=Server.Createobject(adodb.connection) adoconn.OpenDriver={Microsoft Access Driver(*.mdb)};DBQ=& _ Server.MapPath (path where the database is located) |
2. Access OLE DB connection method:
| The following is the quoted content: set adocon=Server.Createobject(adodb.connection) adocon.openProvider=Microsoft.Jet.OLEDB.4.0;& _ Data Source= & Server.MapPath (Path where the database is located) |
3.SQL server connection method:
| The following is the quoted content: set adocon=server.createobject(adodb.recordset) adocon.OpenDriver={SQL Server};Server=(Local);UID=***;PWD=***;& _ database=database name; |
4.SQL server OLE DB connection method:
| The following is the quoted content: set adocon=Server.Createobject(adodb.connection) adocon.openprovider=SQLOLEDB.1;Data Source=RITANT4;& _ user ID=***;Password=***;& _ initial Catalog=database name |
5.Oracle connection method:
| The following is the quoted content: set adocon=Server.Createobject(adodb.connection) adocon.openDriver={microsoft odbc for oracle};server=oraclesever.world;uid=admin;pwd=pass; |
6.Oracle OLE DB connection method:
| The following is the quoted content: set adocon=Server.Createobject(adodb.connection) adocon.openProvider=OraOLEDB.Oracle;data source=dbname;user id=admin;password=pass; |
Share: Common code editing of ASP Calculate the size of the character len() is a character that calculates one, a letter and a lenb() are two letters and characters that are referenced as follows: function getlen(str) n=0 for i=1 to
2 pages in total Previous page 12 Next page