最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp数据连接代码
时间:2022-07-02 22:48:26 编辑:袖梨 来源:一聚教程网
<%
'如果使用国外主页空间,请使用下面语句:'
'rem codepage="936" '
sqlkai=0
Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName
SqlLocalName="(local)"
SqlUsername="nntoa"
SqlPassword="123456"
SqlDatabaseName="sqloa"
dim conn
dim connstr
dim db
'更改数据库名字'
if db="" then db="nntdata/mynntdata.mdb"
on error resume next
Set conn = Server.CreateObject("ADODB.Connection")
if err then
err.clear
Response.Write("
response.end
end if
if sqlkai=1 then
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
else
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")&";Jet OLEDB:Database password="&nt80acmi&""
end if
conn.Open connstr
if err then
err.clear
Response.Write("
response.end
end if
function connClose'关闭数据库
Conn.close
Set conn = Nothing
End Function
%>
相关文章
- Binance.US已上线VIRTUAL 04-30
- binance官网电脑下载_binance苹果版下载地址V2.57.7 04-30
- 比特币交易量最大的交易所是哪个?全球最大的比特币交易平台排名 04-30
- 奥比岛梦想国度卡死闪退有哪些解决方法 04-30
- DNF手游骨戒在哪个位置 04-30
- 回望羊驼:当利空成为短暂的财富密码 04-30