作者fumizuki (蒙面加菲狮)
看板Visual_Basic
标题Re: [ASP ] ASP连结SQL sever问题
时间Sat Nov 11 17:43:41 2006
方法一:
Set conn = CreateObject("ADODB.Connection")
Set cmd = CreateObject("ADODB.Command")
conn.open "log", "test" , "test"
Set cmd.ActiveConnection = cn
cmd.CommandType = 2
'Open Table
cmd.CommandText = "table"
Set rs = cmd.Execute()
方法二:
Set conn = CreateObject("ADODB.Connection")
Set cmd = CreateObject("ADODB.Command")
conn.open "log", "test" , "test"
Set cmd.ActiveConnection = cn
cmd.CommandType = 1
'可以省略这行
cmd.CommandText = "select * from table"
'下查询语法
Set rs = cmd.Execute()
方法三:
Set conn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
conn.open "log", "test" , "test"
Set rs.ActiveConnection = cn
rs.Open "select * from table"
'下查询语法
方法四:
Set conn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
conn.open "log", "test" , "test"
rs.Open "select * from table", conn
'下查询语法
方法五:
Set conn = CreateObject("ADODB.Connection")
conn.open "log", "test" , "test"
Set rs = conn.Execute("select * from table")
'下查询语法
--
▃▅▇▆▄ ▆▂▃ `
逝去感情如何能留住,半点痴情遗留殊不易,██▅▇▄▃ ▇▃▂" .
█████████▃i ▁▄▇
更多凄凄惨惨的遭遇…………██▆▃ █▅▆▃ˍ▄*
◢ ▂█▄▇▅▂▌.
我不知道,王~八~蛋~~! ▂▆███ █▄▃ 。fumizuki。Check。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 210.58.156.20