Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How ASP uses MYSQL Database

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the knowledge of "how ASP uses MYSQL database". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

MYSQL database with its short, convenient, fast, free and other advantages become the preferred database for many websites, but generally use PHP+MYSQL to develop a variety of dynamic pages, in fact, ASP can also use MYSQL database to develop dynamic pages, little brother I have just learned, do not dare to enjoy, so close-up this article for everyone's reference. My environment is WINDOWS98+PWS4.0+mysql-3.23.32-win+PHP4 essential software: PWS4.0 (hehe, nonsense) mysql-3.23.32-win (this is the latest version) myodbc-2.50.36-dll (this is the most important, MYSQL ODBC driver, which can be downloaded from www.mysql.com) the first step: install the MYSQL ODBD driver Copy the downloaded myodbd-2.50.46-dll file to the windowssystem directory (windows2000 is winnt/system32) and create a new file with the extension reg (that is, the registry file), and copy the following to the file. REGEDIT4 [HKEY_LOCAL_MACHINESOFTWAREODBCODBCINST.INImyodbc driver] "UsageCount" = dword:00000002 "Driver" = "C:WINDOWSSystemmyodbc.dll"Setup" = "C:WINDOWSSystemmyodbc.dll"SQLLevel" = "1"FileUsage" = "0"DriverODBCVer" = "02.50"ConnectFunctions" = "YYY"APILevel" = "1"CpTimeout" = "120" [HKEY_LOCAL_MACHINESOFTWAREODBCODBCINST.INIODBC Drivers] "myodbc driver" = "installed" after saving, double-click the file Register the above code in the WINDOWS registry. If installed in windows2000, the values of the Driver and Setup primary keys should be changed accordingly, so I don't need to say much about it here. If successful, you will see the myodbd driver item in the driver of the Control Panel / ODBD data source! Step 2: establish the ASP file link database. There are two ways to do this. One is to create a system DSN in the ODBC data source. Later I found that it was possible to use MYSQL in ASP without building it, and the method is explained below. Open the control panel / ODBD data source, select the system DSN, and then add a new DSN, and the driver selects myodbd driver, and a dialog box appears for entering information about mysql. Windows DSN name: the name of the DSN to be established Mysql Host (name or ip): the name of the Mysql server or IP address, usually fill in localhost Mysql database name: you need to use the name of the database, the database is established in the Mysql manager. Here we use an example. Database name: there are data tables in hc188: user data tables have two fields: username and password. Insert a few data at will. User: the user name of the linked database. I filled in the root superuser password: the user password of the linked database. If not, you can leave Port (if not 3306): the port of Mysql on the server. If you leave it empty, the default is 3306 SQL command on connect: use the sql command to link the database, and select OK to save this item. Link the ASP code of the database below!

Usernamepassword

The second method: I have wondered in use if you do not establish the system DSN, can you also use the MYSQL database? The result is OK. The method is simple, change the second line of the above ASP code to: strconnection= "DefaultDir=;Driver= {myodbc driver}; database=hc188" I am surprised to find that this method can be used without even a user name and password. Is it a BUG of MYSQL? All the above codes have passed the test!

That's all for "how ASP uses MYSQL database". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report