Database connection string of ewebeditor

Source: Internet
Author: User

In the example of ewebeditor, there is a news publishing system. Let's take it as an example to illustrate how ewebeditor connects to the database.

Database-related functions are defined in startup. asp, including sub dbconnbegin (), sub dbconnend (), and other methods for enabling and disabling database connections.

Then all other. asp files are passed <! -- # Include file = "startup. asp" --> to declare that the ". asp" file can directly call the methods declared by startup. asp.

 

In add_save.asp

Strsql = "select * From news_info where 1 <> 1" <br/> set Cn = opendatabase (connstr) <br/> set rs = server. createobject ("ADODB. recordset ")

The "connstr" connection string is defined in conn. asp.

This indicates that the ewebeditor can connect to the database separately. You can use the independent conn. asp to determine which database to connect to without modifying the content of the ewebeditor.

"Connstr" is defined

sqlserver = "computername/sqlexpress" <br/>' if it is SQL Server 2005, it is "Weste/sql2005" <br/> 'if it is SQL Server Express, it is "Weste/sqlexpress" <br/>' the computer name can also be used". "Replace <br/> sqluser =" sa "'database login name <br/> sqlpass =" sa12345 "'database password <br/> sqldata =" Database "'database name </ p> <p> connstr = "provider = sqlncli; data Source = "& sqlserver &"; uid = "& sqluser &"; Pwd = "& sqlpass &"; database = "& sqldata &" "<br/>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.