473,387 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

DB2Connection DLL error VB.NET

seraieis
Hi all,

I've been working on a few home-grown apps for my department, one of which connects to a DB2 database and generates reports from it. It has worked splendidly on my machine, but this morning when I testing it on another users machine, it crashed.

I’ve gotten 2 separate exceptions:
1) System.EntryPointNotFoundException: Unable to find an entry point named ‘nmpTraceOn’ in DLL ‘db2app.dll’.
2) System.DLLNotFoundException: Unable to load DLL ‘db2app.dll’. The specified procedure could not be found.

When I tried to package the DLL in the install file, I still received the same error. I would think it works on my machine because I had the DB2 developers kit installed. Is there a way to get the program to link to that DLL, or am I going to have to get the kit installed on everyone’s machine?

This is the code that generates the error:
Expand|Select|Wrap|Line Numbers
  1.         Dim cn As New DB2Connection( _
  2.             db.cnString & "UID=" & txtUser.Text & _
  3.             ";PWD=" & txtPass.Text)
Thanks!
Jul 10 '08 #1
14 9760
Plater
7,872 Expert 4TB
I think you need to register the dll with windows first.
regdll or something I think. Google how to register .DLL files with windows and you should find it.
I think that needs to be done before you can use it?
Jul 10 '08 #2
I tried to register the DLL on the user's machine, but it was not successful. Any other ideas? I'm about out of them....
Jul 10 '08 #3
Plater
7,872 Expert 4TB
What did the failure say? I am a little confused at how you were using the classes contained withen.
Is this a .NET dll or a COM dll?
You don't reegister .NET dll's with windows but with the CLR in the global assambly cash (GAC). But maybe that only applies to web applications.
Regardless, what type of DLL is it?
Jul 10 '08 #4
I should have been more specific. Registering the DLL didn't fail, but when I reran the program, it still didn't work.

All the DB2 .NET functions work perfectly on my computer. I did an inventory of two users computers, and in the c:\Program Files\SQLLIB\bin folder neither of them have the db2app.dll. I tried simply copying this file to the folder, but, again, that didn't work.

How would I register a DLL with the cache? I am not famliar with the GAC.
Jul 10 '08 #5
Plater
7,872 Expert 4TB
I am thinking the DB2 DLL you are using has some sort of hardpath* in it looking for COM stuff maybe?

* Could also include things like needing the registry entries



Have you tried just using the OleDB namespace and ignoring specific db2 stuff?
http://www.codeproject.com/KB/database/DotnetDb2.aspx
Jul 10 '08 #6
Curtis Rutland
3,256 Expert 2GB
In case you go the way Plater suggested and need it:
This article has more information on using OleDb.

/shameless plug of my own article

Also check connectionstrings.com to find the right connection string.
Jul 10 '08 #7
Thank you both for those responses. I tried it, and it worked a lot smoother on my machine that the DB2 libraries, but i received the following error on another user's machine:

Expand|Select|Wrap|Line Numbers
  1. System.InvalidOperationException: The 'IBMDADB2' provider is not registered on the local machine.
  2.    at System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString constr, DataSourceWrapper& datasrcWrapper)
  3.    at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
  4.    at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
  5.    at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
  6.    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
  7.    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
  8.    at System.Data.OleDb.OleDbConnection.Open()
  9.    at WindowsApplication1.Form1.ExecQuery()
  10.  
When I tried to register the DLL with the user's machine, it said something along the lines of "the specified module cannot be found", even though i used an absolute path. This may be a permissions issue, in which case I could have local support come up and register the DLL with her machine.

Any other ideas before I involve support? Thanks!
Jul 11 '08 #8
Plater
7,872 Expert 4TB
This
The 'IBMDADB2' provider is not registered on the local machine.
sounds like there is no DB2 drivers installed on that machine, which is roughly were we started this problem.
You check to see if IBM has any free drivers for it?
Jul 11 '08 #9
There are DB2 drivers on their machine. I ran a directory map of their computer and they both have the files, and the ibmdadb2.dll are in the Windows registry.

Is there a way to hardcode where a VB.NET app looks for a DLL? If that's the case, i could package the DLL with the program and distribute it that way.
Jul 11 '08 #10
jhaxo
57
There are DB2 drivers on their machine. I ran a directory map of their computer and they both have the files, and the ibmdadb2.dll are in the Windows registry.

Is there a way to hardcode where a VB.NET app looks for a DLL? If that's the case, i could package the DLL with the program and distribute it that way.
Did you run the db2 client install on the target machine? I have done these kind of apps and it always worked smoothly for me.
The installation will take care of registration and perhaps any arcane files that might need to be there plus its all nice and legal.
Jul 11 '08 #11
jhaxo
57
Thank you both for those responses. I tried it, and it worked a lot smoother on my machine that the DB2 libraries, but i received the following error on another user's machine:

Expand|Select|Wrap|Line Numbers
  1. System.InvalidOperationException: The 'IBMDADB2' provider is not registered on the local machine.
  2.    at System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString constr, DataSourceWrapper& datasrcWrapper)
  3.    at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
  4.    at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
  5.    at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
  6.    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
  7.    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
  8.    at System.Data.OleDb.OleDbConnection.Open()
  9.    at WindowsApplication1.Form1.ExecQuery()
  10.  
When I tried to register the DLL with the user's machine, it said something along the lines of "the specified module cannot be found", even though i used an absolute path. This may be a permissions issue, in which case I could have local support come up and register the DLL with her machine.

Any other ideas before I involve support? Thanks!
there might be some required dlls causing registration to fail. also, just a thought, is there a microsoft driver you can use instead? or another ibm driver you can use such as odp.net? i forgot to mention that in my last post, i think its available freely and you would install it together with your program on each client.
Jul 11 '08 #12
I've contacted local support to get the DB2 Connect package installed on the users computer to see if that solves the problem. However, with the way things work in this company, it probably won't get installed until next week, so I'll post again once I can test it.

Regardless, I want to thank everyone for their advice and suggestions. I'll let you all know how it goes :)


Dan
Jul 11 '08 #13
The DB2 Connect package did the trick!

Again, I want to thank you for all your help in this. You guys are amazing!
Jul 16 '08 #14
It's nice to see that I'm not the only one creating homegrown applications. But I think I'm in the same boat with db2app.dll.

I have something installed on my PC called DB2 Universal Database Personal Edition. It comes with utilities like Command Center and Control Center. I get the feeling it's not the same thing as the DB2 Connect Package . Could you give me a little more information about that software so I know what to ask for?

Thank you.

-Brian
Sep 7 '08 #15

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: global | last post by:
Hi, can anyone help me I'm on Linux with UDB Runtime-Client 8.1.4 and try to connect to a windows udb-server 8.1.4 via Websphere and jdbc , and get this error: 3e1a29e5 WebGroup E...
1
by: Freddy | last post by:
DB2 Connect version 7.2 to Mainframe We have one workstation which through JDBC continues to truncate a VARCHAR column at 254 characters. We've uninstalled and reinstalled DB2 Connect on this...
3
by: StephenRichter | last post by:
I have installed the trial of db2 enterprise server on my w2k PC. Have also installed fix pack 8 of that product. I am using it to connect from an asp.net web page to an IBM as400. the 400 is...
1
by: Praveen | last post by:
Hi, I have installed WebSphere Portal on AIX and connected to DB2 on a remote machine, Getting the followin errors when trying to get the values from database thru applications installed on...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
seraieis
by: seraieis | last post by:
I have a program that, within a BackgroundWorker, runs a small SELECT query from a DB2 Database. The basic form looks like this: BackgroundWorkerFunction(BackgroundWorker b) - open...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.