Recommended: How to prevent ASP from logging in at the same time There are two ways to implement this function: 1. application: If you are doing a large community, you may have to generate an application for each login id. Although the program design will be simpler, the login user is too many and it consumes server resources. It is never recommended here, because the application object is easy to generate when the user login.
This article mainly introduces the common syntax of 11 databases in ASP programming.
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; |
7.dBase connection method:
| The following is the quoted content: set adocon=Server.Createobject(adodb.connection) adocon.openDriver= {microsoft dbase driver(*.dbf)};driverid=277;dbq=--; |
8.mySQL connection method:
| The following is the quoted content: set adocon=Server.Createobject(adodb.connection) adocon.openDriver={mysql};database=yourdatabase; uid=username;pwd=yourpassword;option=16386; |
9. Visual Foxpro connection method:
| The following is the quoted content: set adocon=Server.Createobject(adodb.connection) adocon.openDriver={microsoft Visual Foxpro driver}; sourcetype=DBC;sourceDB=*.dbc;Exclusive=No; |
10.MS text connection method:
| The following is the quoted content: set adocon=Server.Createobject(adodb.connection) adocon.openDriver={microsoft text driver(*.txt; *.csv)};dbq=-----;&_ extensions=asc,csv,tab,txt;Persist SecurityInfo=false; |
11.MS text OLE DB connection method:
| The following is the quoted content: set adocon=Server.Createobject(adodb.connection) adocon.openProvider =microsof.jet.oledb.4.0;data source=your_path;&_ Extended Properties'text;FMT=Delimited' |
Share: Several ways to call stored procedures with parameters Several ways ASP calls stored procedures with parameters1 This is also the easiest method, two input parameters, no return value: set connection = server.createobject(adodb.connection) connection.open someDSN Connection.Execute procname varvalue1, varvalue2 'Clear all objects as nothing, free up resources