Date: 2001-7-4 23:30:00 Source: aspcn Author: crispy rice paste
The mysql database has become the current preferred database of many websites in a short, convenient, speed, free and other advantages, but generally use PHP MySQL to develop various dynamic pages, in fact, ASP can also use the mysql database to develop dynamic pages, your younger brother I am also just learning, I don't dare to enjoy, so I close this article for everyone. My environment is Windows98 PWS4.0 mysql-3.23.32-win php4 necessary software: PWS4.0 (huh, nonsense) mysql-3.23.32-win (this is the latest version) myodbc-2.50.36 -dll (this is the most important, mysql odbc driver, you can download www.mysql.com) Step 1: Install the mysql odbd driver, copy the downloaded myodbd-2.50.46-dll file to Windows / In the system directory (Windows2000 is Winnt / System32) and then create a new file, the extension is REG (that is, the registry file), copy the following to the file. Regedit4 [HKEY_LOCAL_MACHINE / SOFTWARE / ODBC / ODBCINST.INI / Myodbc Driver] "usageCount" = dword: 00000002 "driver" = "c: //windows//system/Myodbc.dll" "setup" = "C: // Windows // system // myodbc.dll "SQLLEVEL" = "1" "Fileusage" = "02.50" "" "" "" "" "" "" "" "" "=" = "1" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " 120 "[HKEY_LOCAL_MACHINS / SOFTWARE / ODBC / ODBCINST.INI / ODBC DRIVERS]" Myodbc Driver "=" installed "After saving, the above code is registered in the Windows Registry. If installed in Windows2000, the value of Driver and Setup primary key should change accordingly, I don't have to say more here. If successful, you will see the Myodbd Driver in the driver of the control panel / ODBD data source! Step 2: Establish an ASP file link database. There are two methods here, one is to establish a system DSN in the ODBC data source. Later I found that I don't build, I can use MySQL in the ASP, and the method will take place below. Open the control panel / ODBD data source, select the system DSN, then add a new DSN, the driver selects Myodbd Driver, and a dialog box will appear for entering mysql related information. Windows DSN Name: The name of the name mysql host (Name or IP): MySQL server name or IP address, usually fill in LocalHost MySQL Database Name: The name of the database is required, the database is established in the MySQL manager. Here we use an example.
Database Name: HC188, there is a data table: USER Datasheets have two fields: username and password, plus several data. User: Link database username, I fill up the root superuser password: link database user password, if not, you can not fill port (if not 3306): MySQL at the server's port, if you don't fill 3306 SQL COMMAND ON Connect: Use the SQL command to link the database, which can be saved after you can save it after you finish writing. The following links the database ASP code! <% StrConnection = "dsn = hc188; driver = {myodbd driver}; server = localhost; uid = root; pwd =; database = hc188" Set adoDataConn = Server.CreateObject ( "ADODB.Connection") adoDataConn.Open strConnection strQuery = "Select * from user" set RS = adodataconn.execute (strquery) if not xi ot%>