大家知道asp连接SQLserver数据库吗?在使用asp语言建立网站时,常常需要用数据库记录一些信息,如访客发表的留言、访客访问时间等。此时就需要用到asp连接数据库的代码连接数据库后便于进行数据添加删除等操作。
主要是讲sql server连接方法与sql server ole db连接方法。
sql server连接方法:set adocon=server.createobject("adodb.recordset")
adocon.open"driver={sql server};server=(local);uid=***;pwd=***;"& _ "database=数据库名;"sql server ole db连接方法:set adocon=server.createobject("adodb.connection")
adocon.open"provider=sqloledb.1;data source=ritant4;"& _ "user id=***;password=***;"& _ "inital catalog=数据库名"
来源: http://www.51edu.com/it/bckf/490519.html