Re: [問題] ADODB.Connection and Command???
※ 引述《lukevin1026 (kevin)》之銘言:
: 我是用dw8做asp asp javascript 想做商品展示的網頁
: 有放在一個付費的空間中 但空間 需要 用 在 ''ASP 中不設定
: ODBC介面直接設定連結的資料庫''
: Set Conn = Server.CreateObject("ADODB.Connection")
: 而我用dw 繫結 聯結資料庫 都是
: Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
: 要如何用dw做出符合.Connection的asp???
: 不是用繫結>資料庫 嗎??
: 謝謝~ 感激不盡!!!!!
看你目標細節的資料庫是甚麼XD
ex. Access
function getAccessCon(str) 'str為檔案路徑與名稱
Set getAccessCon = Server.CreateObject("ADODB.Connection")
'建立Connection(資料庫連結)物件,並設定由conn物件變數引用
StrCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath(str)
getAccessCon.Open StrCon '開啟資料庫
end function
ex.ms sql
//for ms sql
Set cn=Server.CreateObject("ADODB.Connection")
Set rstObj=SERVER.CreateObject("ADODB.Recordset")
cn.Open "Provider=SQLoledb;" & _
"Data Source=(local);" & _ '註: (local)可改為資料庫位置
"User ID=user;Password=pwd;" & _
"Initial Catalog=" & dbname 'dbname是目標的資料庫名
其實重點就是在於 Connection根據你用的資料庫、環境不同
而寫成不同的值而已...:P
--
String temp="relax"; | Life just like programing
while(buringlife) String.forgot(temp); | to be right or wrong
while(sleeping) brain.setMemoryOut(); | need not to say
stack.push(life.running); | the complier will
stack.push(scouting.buck()); | answer your life
stack.push(bowling.practice()); | Bone everything
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.134.27.68
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):