作者TonyQ (骨头)
看板Web_Design
标题Re: [问题] ADODB.Connection and Command???
时间Sun Feb 4 09:24:56 2007
※ 引述《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