Skip to main content

developerWorks >  Information Management  >  Forums  >  .NET Development with DB2 and IDS  >  developerWorks

ASP.NET cannot connect to Express-C 9.7 via OleDB.NET on Vista x64    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
This question is not answered.

Permlink Replies: 1 - Pages: 1 - Last Post: Nov 5, 2009 1:42 PM Last Post By: Prashant Kulkarni Threads: [ Previous | Next ]
maether

Posts: 1
Registered: Sep 12, 2009 08:34:21 PM
ASP.NET cannot connect to Express-C 9.7 via OleDB.NET on Vista x64
Posted: Sep 12, 2009 10:25:25 PM
 
Click to report abuse...   Click to reply to this thread Reply
Hello.

I'm posting here hoping to get a load off my mind and maybe some help (TIA). My frustration level has reached the zenith.

About week ago I've downloaded Express-C 9.7 x64 in order to use it with OleDB.NET on Vista x64 with .NET 3.5 SP1. I cannot use any other approach (ODBC, ADO.NET, etc.) since relying on OleDB.NET is one of project's requirements (in order to allow users to quickly and painlessly get data from various databases in without recompiling whole application). Using 32bit components and/or OS is not an option.

First test using desktop application written in C# was promising albeit slower than Oracle XE and SQL Server 2008 Express (but still acceptable). The same code with the same connection string causes an 'The IBMDADB2 Provider is not registered on the local machine' exception in ASP.NET 3.5 (testconn20 also bails out).
And yes, I have tried to use
db2nmpcfg -register -level 9.7.0 -db2path "c:\program files\ibm\sqllib"
without any success (the application added entries for .NET providers but OleDB wasn't present).

Registering IBMDADB2.DLL using regsvr32 had always resulted in errors received from DllRegisterServer. After downloading and installing the IBM Data Server Client 9.7 x64 package registration succeded but ASP.NET still wasn't able to see the provider.

After reading that this could be a file permission issue I have added full access permissions for users/groups:
SYSTEM
LOCAL SERVICE
NETWORK SERVICE
DB2ADMNS(containing my own developer account, DB2's own account, IUSR and SYSTEM)
DB2USERS (with the same members as DB2ADMNS)
IIS_IUSRS
IUSR
Everyone
my own developer
DB2's account
for SQLLIB folder, BIN folder and both IBMDADB2.DLL and IBMDADB264.DLL files.

The d4mn thing still doesn't work in ASP.NET after one week of constant testing different software/permission configurations (with several reinstallations of the product).

What am I doing wrong? Is providing a little script or simple(!) setup tool too difficult for IBM?

Sorry for ranting but I've had enough of fighting against thing that should work out-of-box (as in MS SQL Server 2008 Express) or with minimal effort put into (as in Oracle XE).
Prashant Kulkarni

Posts: 1
Registered: Nov 05, 2009 01:14:11 PM
Re: ASP.NET cannot connect to Express-C 9.7 via OleDB.NET on Vista x64
Posted: Nov 05, 2009 01:42:15 PM   in response to: maether in response to: maether's post
 
Click to report abuse...   Click to reply to this thread Reply
Hi
Since you are getting the error 'The IBMDADB2 Provider is not registered on the local machine' could you try following?
Also let me know what is the regisration error you are recieving.

1)You can also manually check whether this reg key is present HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\IBM\DB2\InstalledCopies\DB2COPY1\InstallData\OLEDB] , and its values are set correctly
for example ( the reg key values may be differnt from your own machine)

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\IBM\DB2\InstalledCopies\DB2COPY1\InstallData\OLEDB
"IBMDADB2"="{A7D026DF-7230-4160-86FA-1845E6111F2A}"
"IBMDADB2 Connection Page"="{30EEF318-A918-4DBC-92D0-550BB004D0D5}"
"IBMDADB2 Advanced Page"="{7D607C5B-35EF-460A-8FC8-B3F3D63F7C82}"
"IBMDADB2 Enumerator"="{2A38C2D8-C32F-4E14-BF6A-397B3CA0FE6A}"
"IBMDADB2 Error Lookup"="{C47EF785-A215-496A-B4C3-E3208739562D}"

Now, you can run the command line (eg. "c:\windows\syswow64\regsvr32 ~\sqllib\bin\ibmdadb2.dll") to register the 32-bit OLEDB DLL again

2)Also for one of the customer the issue is resolved after turning external security off. for that customer The problem turned out to be access issues with the directory Program Files on the D: drive for NT
AUTHORITY\NETWORK SERVICE
more information
http://msdn.microsoft.com/en-us/library/ms998320.aspx
http://social.msdn.microsoft.com/forums/en-US/adodotnetdataproviders/thread/a31656a9-5715-4910-ad96-fa590344a407/
http://www.ibm.com/developerworks/forums/thread.jspa?messageID=13960949

3) http://www.ibm.com/developerworks/forums/thread.jspa?messageID=13960949

4) To verify if the OLEDB provider is really giving error can you try the below Visual Basic code in the follwing lines ( the code is written in command button handler)
if you are getting some records from staff table then atleast OLEDB provider is registered properly by Install otherwise
there may be problem in install.

Private Sub Command1_Click()
On Error GoTo Handle_Error
Dim oConexao As ADODB.Connection
Dim rsDados As ADODB.Recordset

Dim sql As String
Set oConexao = CreateObject("ADODB.Connection")
oConexao.Open "Provider=IBMDADB2;Password=xxxx,;User ID=myid ;Data Source=sample"

oConexao.CursorLocation = adUseClient

MsgBox oConexao.ConnectionString

Set rsDados = New ADODB.Recordset

sql = "SELECT * FROM staff"
rsDados.MaxRecords = 2
rsDados.Open sql, oConexao

MsgBox "Recordcount = " & rsDados.RecordCount

If Not rsDados Is Nothing Then
While Not rsDados.EOF
MsgBox rsDados.Fields(0).Name & " = " & rsDados.Fields(0).Value
rsDados.MoveNext
Wend
End If

oConexao.Close
Exit Sub

Handle_Error:

MsgBox "ERROR Descxription: " & Err.Description & "Error number: " & Err.Number

oConexao.Close

Set oConexao = Nothing
Set rsDados = Nothing

End Sub

Regards
Prashant
 Tags
Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

 

MoreLess 


Point your RSS reader here for a feed of the latest messages in all forums