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