Dear Everybody,

 I installed Oracle Database 10g Express Edition (Universal) on the Server Host.

And then, I used Ironpython access this database on server host by Microsoft OLE DB Provider for Oracle. It's work.

import clr

import System

clr.AddReference("System.Data")

from System.Data import DataSet

from System.Data.OleDb import OleDbConnection, OleDbDataAdapter, OleDbCommand

conStr = "Provider=MSDAORA.1;User ID=name;Password=pwd;Persist Security Info=False"

con = OleDbConnection(conStr)

query = "SELECT * FROM TEST"

adapter = OleDbDataAdapter(query,con)

ds = DataSet()

con.Open()

adapter.Fill(ds,"t1")

for i in range(ds.Tables["t1"].Rows.Count -1 ):

print ds.Tables["t1"].Rows[i][0]

print ds.Tables["t1"].Rows[i][1]

print ds.Tables["t1"].Rows[i][2]

con.Close()

But my problem is I can't access Oracle Server side from client side by the same provider.

I changed conStr to this

conStr = """Provider=MSDAORA.1;User ID=name;Password=pwd;
  (DESCRIPTION=(CONNECT_DATA=(SID =XE)
  (CID=(PROGRAM=C:\WINDOWS\system32\Rundll32.exe)
  (HOST=hostname)(USER=name)))
  (ADDRESS=(PROTOCOL=TCP)(HOST=xx.yy.zz.ww)
  (PORT=1521)))"""

I got EnvironmentError: ORA-12560: TNS:protocol adapter error

I don't know how to solve this problem.

Please help me everything i missed and everything i should know. What I should do or change something, please tell me.

Thank you.



 

 



Puzzles, trivia teasers, word scrambles and more. Play for your chance to win!
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to