asp连接sql数据库
第一种写法:

MM_conn_STRING = "Driver={SQL Server};server=(local);uid=sa;pwd=;database=infs;"
Set conn = Server.Createobject("ADODB.Connection")
conn.open MM_conn_STRING
SET RS=SERVER.CreateObject("ADOBD.recordset")
SQL="SELECT * FROM TABLE ORDER BY ID DESC"
RS.open SQL,CONN,3,3  

//第二种写法:(DSN连接)

[/code]MM_conn_STRING=”DSN=BBS;UID=SA;PWD=12345″
Set conn = Server.Createobject(“ADODB.Connection”)
conn.open MM_conn_STRING
SET RS=SERVER.CreateObject(“ADOBD.recordset”)
SQL=”SELECT * FROM TABLE ORDER BY ID DESC”
RS.open SQL,CONN,3,3 // 3,3是修改、删除、增加开关!


//第三种写法:

MM_conn_STRING_own = “Driver={SQL Server};server=(local);uid=sa;pwd=11111;database=infs;”
Set conn = Server.Createobject(“ADODB.Connection”)
conn.open MM_conn_STRING_own


//第四种 - 这种方法用在ACCESS中

strconn = “DRIVER=Microsoft Access Driver (*.mdb);DBQ=” _
& Server.MapPath(“asp.mdb”)
set conn = server.createobject(“adodb.connection”)
conn.open strconn

asp连接sql数据库

随机文章

VSC:Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:9222
VSC:Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:9222

Java基础第八讲:面向对象基础(二)
Java基础第八讲:面向对象基础(二)

android常用的junit
android常用的junit

百度搜索真坏啊
百度搜索真坏啊

angularjs2会报错“GET http://127.0.0.1/traceur 404 (Not Found)”
angularjs2会报错“GET http://127.0.0.1/traceur 404 (Not Found)”

三星首次承认正在研发智能手表
三星首次承认正在研发智能手表

内容分享:道招
本文链接:asp连接mssql数据库代码大全
道招声明:除特别标注或作者不详外,本站所有文章均为原创,转载请注明。欢迎共同关注互联网!