关于ASP语法..(ADO) [英] About ASP syntax..(ADO)
问题描述
真正的Sever:Window Server 2003,DB Oracle 9i
本地服务器:Window7 64位,DB Oracle 11g客户端32位
-------------------------------------------- -
##真正的Sever来源。
-------------------------- --------------------
real Sever : Window Server 2003 , DB Oracle 9i
local Server : Window7 64bit , DB Oracle 11g client 32bit
----------------------------------------------
## real Sever Source.
----------------------------------------------
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.open "Provider=MSDAORA.1;Data Source=CS_TEST.world;User Id=trnusr;Password=trnusr0515"
SQL = "Select store_cd, store_kor_nm from MSTADM.CSMST09TB"
Set Rs = Server.CreateObject("ADODB.Recordset"")
set rs = createobject("adodb.recordset"")
set rsCmd = createobject("adodb.Command"")
set rsCODE = createobject("adodb.Parameter"")
rsCmd.ActiveConnection = conn.connectionstring <==== here!!!!
rsCmd.CommandType = 1
rsCmd.CommandText = SQL
set rs = rsCmd.execute
set rsCmd = nothing
set rsCODE = nothing
If conn.errors.count = 0 Then
Response.Write("OK")
else
Response.Write(conn.errors(0).description)
Response.Write(conn.connectionstring)
End If
-------------------------------------- ----------------------------
##到本地服务器
- -------------------------------------------------- ---------------
rsCmd.ActiveConnection = conn.connectionstring
=>不工作
rsCmd.ActiveConnection = conn
=>工作
有什么问题?
我希望解决方案,请!!
谢谢!!
------------------------------------------------------------------
## To local server
------------------------------------------------------------------
rsCmd.ActiveConnection = conn.connectionstring
=> not working
rsCmd.ActiveConnection = conn
=> working
what's problem?
I hope the solution, please!!
Thank you!!
推荐答案
我想创造环境开发。
所以从Real-Sever Source复制到本地电脑。
但是来源不能在本地电脑工作。
=> ; rsCmd.ActiveConnection = conn.connectionstring(原创)
我修好了。 (rsCmd.ActiveConnection = conn)
然后它正在工作。
我想知道原因。
I want to make environment for development.
So Copy to local pc from Real-Sever Source.
But The Source is not working at local pc.
=> rsCmd.ActiveConnection = conn.connectionstring (Original)
Sot I repaired it. ( rsCmd.ActiveConnection = conn )
And then it's working.
I want to know the reason.
Refer - < a href =http://msdn.microsoft.com/en-us/library/windows/desktop/ms676107(v=vs.85).aspx> ActiveConnection Property(ADO)。 ActiveConnection
接受 Connection
对象,而不是字符串。由于 conn.connectionstring
是一个字符串
,所以它不起作用。它适用于conn,因为它是 Connection
Object。
Refer - ActiveConnection Property (ADO). ActiveConnection
takes a Connection
object, not a string. As conn.connectionstring
is a string
, so it does not work. It worked with conn, because it is a Connection
Object.
这篇关于关于ASP语法..(ADO)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!