|
比如要连接168.168.168.168上的数据库,服务名Orant,服务已启动,端口1521,最好不要安装Oracle客户端。 Dim connStr As String connStr = <如何写?> With conn .ConnectionString = connStr .CursorLocation = adUseClient .Open End With |
|
|
|
不用安装客户端可以吗?
|
|
|
http://support.microsoft.com/default.aspx?scid=kb;EN-US;176936
|
|
|
微软的:
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q176/9/36.asp&NoWebContent=1 |
|
|
ODBC Driver for Oracle For the current Oracle ODBC Driver from Microsoft: Conn.Open "Driver={Microsoft ODBC for Oracle};" & _ "Server=OracleServer.world;" & _ "Uid=myUsername;" & _ "Pwd=myPassword;" For the older Oracle ODBC Driver from Microsoft: Conn.Open "Driver={Microsoft ODBC Driver for Oracle};" & _ "ConnectString=OracleServer.world;" & _ "Uid=myUsername;" & _ "Pwd=myPassword;" |
|
|
不安装好象不行吧!我都是安装的。
|
|
|
dim cn as adodb.connection
dim cnstr as string cnstr="Provider=MSDAORA.1;Password=pws;User ID=username;Data Source=168.168.168.168;initial catalog=dbname;Persist Security Info=True" cn.cnstr |
|
|
cn.open"Provider=MSDAORA.1;Password=pws;User ID=username;Data Source=168.168.168.168;initial catalog=dbname;Persist Security Info=True"
|
|
|
TO sword281() AND yoki(小马哥) :
"initial catalog=dbname",这里"dbname"要写什么? TO strongfisher(Haiwolf) : connStr = "UID=*****;PWD=****;DRIVER={Microsoft ODBC for Oracle};" _ & "SERVER=*****;" 那篇文章我看过,但不知道就上面的例子来说"SERVER=*****;"该写什么? TO everyone: 我也不知道不装客户端是不是可以,但有人说可以 |
|
|
dbname是要连接的连接数据库的文件名,
SERVER=*****;*是要连接的数据库的全名 |
|
|
TO sword281() :
我还是不大明白,能否举例说明? 比如我要连168.168.168.168上的数据库,数据库的文件名?"C:\Orant\database\dbname.DBF"? 谢谢 |
|
|
查阅了一些资料,不装客户端还是不可以
这里面有理由 http://dbforums.com/archives/t312203.html |
|