Wpf desktop, oracle and sql.ini

General discussion forum about all databases other than SqlBase.
ozmenbetul
Turkey
Posts: 286
Joined: 28 Aug 2019, 08:57
Location: Turkey

Wpf desktop, oracle and sql.ini

Post by ozmenbetul » 01 Jun 2013, 13:00

Hello,
I succesfully connect to Oracle when the build option is win32.
When I change to WPF desktop and run the program, I get
"Connection error : Sql.ini missing win32client.dll"
I check my sql.ini which is in the appliction path and it has [win32client.dll] section.
My OS is windows 7 and I have Oracle 11g installed.
I also added my application path to the environment variables/path.

From sql.ini :
[win32client.dll]
comdll=sqlora32
comdll=sqlodb32
comdll=sqlws32


So, what is really missing?
I strongly need this to proceed.

Thank you.
Betul

ozmenbetul
Turkey
Posts: 286
Joined: 28 Aug 2019, 08:57
Location: Turkey

Re: Wpf desktop, oracle and sql.ini

Post by ozmenbetul » 10 Jun 2013, 13:36

Hmmm, I think I'm one step forward, now.

I ran this command :
regsvr32 C:\app\<users>\product\11.2.0\client_1\BIN\OraOLEDB11.dll
For me it is,
regsvr32 D:\app\BETUL\product\11.2.0\client_1\bin\OraOLEDB11.dll

Then I created an empty file by notepad and named it "a.udl"

I opened the Properties of the udl file.
I chose "Oracle Provider for OLE DB" from the "Providers" tab.
Then from the "Connections" tab,
I defined the data source, user and password for my oracle database.
I saved the changes.

I opened an empty notepad file and dragged and dropped the a.udl into it
and I saw this :

[oledb]
; Everything after this line is an OLE DB initstring
Provider=OraOLEDB.Oracle.1;Password=myPassWord;Persist Security Info=True;User ID=myUser;Data Source=MyDataSource

I used this string as a connection string :
Set strSessionProperties = "Provider=OraOLEDB.Oracle.1;Password=myPassWord;Persist Security Info=True;User ID=myUser;Data Source=MyDataSource"
Call SqlCreateSession( hSession, strSessionProperties )

and the application now connects to Oracle in WPF Desktop mode.

I did all these after noticing these instructions from the DotNet.pdf book :
Connecting to Oracle
1. When developing WPF applications which go against an oracle database you
must use the Oracle 11gR2 32bit client.
2. The Oracle11gR2 32bit client can be used to go against an oracle10g or oracle11g
database.
3. There is no need to configure an oracle .NET connection as that Team Developer
will automatically map your native and/or OLEDB connections to equivalent
.NET connection(s).
How to configure an oracle OLEDB UDL file:
1. Open the command prompt and register the Oracle 11gR2 32bit OLEDB driver:
regsvr32 C:\app\<users>\product\11.2.0\client_1\BIN\OraOLEDB11.dll
2. Launch the "Data Link Properties" dialog for the udl file you want to configure:
rundll32.exe "%ProgramFiles(x86)%\Common
Files\System\OLEDB\oledb32.dll", OpenDSLFile "<path to udl
file>\<udlfile>.udl"


But now, I'm a bit confused :|
Does this mean that
oracle native connection is oracle ole db connection in .Net?
Or no, I'm just connecting via ole db, this is nothing to do with native connection.

Thanks for any idea.
Regards,
Betul

ozmenbetul
Turkey
Posts: 286
Joined: 28 Aug 2019, 08:57
Location: Turkey

Re: Wpf desktop, oracle and sql.ini

Post by ozmenbetul » 14 Jun 2013, 17:26

Hello all,
I found out that
this nothing to do with Oracle.
I was usually connecting to Sql Server via OLEDB.
This time I developed an app to test connections, and I used Sql ODBC.
I got the same error : Connection error : Sql.ini missing win32client.dll
I actullay had that seciton in my sql.ini and I was sure I was accessing the right sql.ini.
I said a "Hmmmm"...
Thought, thought, thought...
Than a "hmmmm" again...
And a quiet voice echoed in my brain :
"Why don't you try it with English regional settings?"

My regional settings is Turkish. Changing it to English, I got rid of this terrible fault ;-)
And now I'm switching to the bug reports forum to report this.

Have a nice weekend!
Betul,
yes, from Turkey ;-)

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests