ASP connection database full-capacity code

xiaoxiao2021-03-06  41

'Solve the problem of Access database path! 'Use dbtype = 0 or dbtype = 1 to distinguish the AC library or the MSSQL library' specifically adopted the AC library, see the program description

DIM DBTYPE, CONN, STRCONN

DBTYPE = 0

'0 is an Access database, 1 for the MSSQL database

IF (dbtype = 0) Then '********************************************* **************************** DIM DBFOLDERNAME, DBFOLDER_PATH, SiteFolderDbFoldername = "articleData" database location folder name dbfolder_path = server.mAppath (Dbfoldername) 'Database location path sitefolder = "article" "The root directory name where the system is located

IF session ("rootdir") = "" "" Rootdir ") = MID (DBFolder_Path, 1, INSTR (1, DBFolder_Path, SiteFolder, 1) -1) & SiteFolder End if set conn = server.createObject (" AdoDB .Connection ") strconn =" driver = {Microsoft Access Driver (* .mdb)}; dbq = "& session (" rootdir ") &" & dbfoldername & "/data.mdb" connected to database conn.open StrConn '********************************************************** ********************************* Elseif (dbtype = 1) Ten '******** *************************************************************************************************************************************************TION *********** DIM DBUSERID, DBPASSWORD, DBNAME, DBPASSWORD, DBNAME, DBIP 'Modify the following information to suit your website dbuserid = "sa"' database login name dbpassword = "" "Database password dbname =" dbname "' Database Name DBIP = "local" 'database where the local database is: (local)

转载请注明原文地址:https://www.9cbs.com/read-65924.html

New Post(0)