導航:首頁 > 編程大全 > asp連接oracle資料庫語句

asp連接oracle資料庫語句

發布時間:2023-12-10 03:10:25

㈠ ASP連接資料庫的連接方法

access的連接字元串
<%
db="資料庫路徑"
connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
on error resume next
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
if err then
response.write err.discription
Err.Clear
conn.close
set conn=nothing
Response.Write "資料庫連接出錯,請檢查連接字元串。"
Response.End
end if
%>
sqlser連接
<%
Sql_Server = "伺服器地址"
Sql_User = "資料庫賬號"
Sql_Pass = "密碼"
Sql_Data = "資料庫名"

dim Conn,connstr
connstr = "PROVIDER=SQLNCLI;DATA SOURCE="&Sql_Server&";UID="&Sql_User&";PWD="&Sql_Pass&";DATABASE="&Sql_Data
set Conn = server.createobject("ADODB.connection")
Conn.open connstr
if err then
response.write err.discription
Err.Clear
conn.close
set conn=nothing
Response.Write "資料庫連接出錯,請檢查連接字元串。"
Response.End
end if
%>

閱讀全文

與asp連接oracle資料庫語句相關的資料

熱點內容
g76沒退刀槽怎麼編程 瀏覽:749
5位qq貼吧 瀏覽:470
appinventor求時長 瀏覽:473
手機網路密碼忘了怎麼辦 瀏覽:945
太陽電池模擬模塊matlab程序 瀏覽:423
w7文件加密 瀏覽:749
網通密碼查看器 瀏覽:851
應用圖像和計算的實例教程 瀏覽:545
40級qq多少錢 瀏覽:488
表格如何自動生成數據 瀏覽:299
手機qq拉黑怎麼恢復 瀏覽:456
java判斷某個文件是否存在 瀏覽:169
華為g7雙4g版265如何回退258版本 瀏覽:984
最接近機器的編程語言叫什麼 瀏覽:408
手機數據解鎖有什麼用 瀏覽:912
如何從零基礎學習一個編程 瀏覽:285
清理c盤休眠文件大小 瀏覽:3
怎麼給app添加想要的功能 瀏覽:180
國家手機型號代碼 瀏覽:630
格式化json輸出 瀏覽:679

友情鏈接