CSDN博客

img ielong

asp 接数据库方法(oracle&mssql)

发表于2004/9/20 12:12:00  312人阅读


set conn=server.createobject("adodb.connection")
connstr="Provider=OraOLEDB.Oracle.1;Persist Security Info=True;User ID=bai;Password=bai;Data Source=dates"
conn.Open connstr


strSQLServerName = "(local)"      '服务器名称或地址
strSQLDBUserName = "sa"             '数据库帐号
strSQLDBPassword = "baijunyi"               '数据库密码
strSQLDBName = "main"             '数据库名称
-----------------------------------------------------------------------------------------------

SQL Server OLE Driver
Set conn = Server.CreateObject("ADODB.Connection")
strCon = "Provider=SQLOLEDB.1;Persist Security Info=False;Server=" & strSQLServerName & ";User ID=" & strSQLDBUserName & ";Password=" & strSQLDBPassword & ";Database=" & strSQLDBName & ";"

conn.Open strCon

0 0

相关博文

我的热门文章

img
取 消
img