DB-Library Error 10001: NULL DBPROCESS pointer encountered

Flexology used Ask the Experts™
We have a Windows 2003 Server running MS SQL 2000 SP3. We have a 3rd party application that uses the DB Library which has been connecting OK for about 1yr, then last month it started to not connect.

We could re-start the app 3 or 4 times and it would eventually connect.

Nothing has been added to the server except the usaul MS Windows patches etc..

I've since written a simple DB Library app which connects into the same system/database and like the other one it sometimes won't connect. It outputs the following SQL error:
"DB-Library Error 10001: NULL DBPROCESS pointer encountered."

Any ideas gratefully received

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2012

OK, maybe let's start at the basic point: Is that DB server reachable at all? According to the MS docs on that error message, it means that no connection could be established, so I'd check (in that order):

- physical network connection (is the cable plugged?)
- protocol connection (can I ping that box?)
- permission check (is my account allowed to connect?)
- do SQL requests reach the server (is there any activity on the server side when you try to connect?)


Hi jkr,
The app and database are on the same server. It can connect on that username / password as it does sometimes connect and we can use those credentials for ODBC & ADO and it works each time.

When it won't connect via the DB Library I can access it using ADO, ODBC so it looks like it's specific to the DB Library

>>>> NULL DBPROCESS pointer encountered
That means that one of the calls to DBLibrary passes a NULL pointer where a valid DBPROCESS pointer was required. I assume that a previous action had failed which causes the DBPROCESS pointer to be corrupted or not being set correctly. As it works occassionally and had worked in the path, I would suggest that the pointer was overwritten by some previous code, e. g. by a loop that writes beyond array boundaries and occasionally overwrites a valid pointer value.

>>> ... and like the other one it sometimes won't connect.
Can you debug the test app and check each single call to the DBLibrary, each argument passed and each return value? Also check for allocation. If for example you are allocating too less storage for any of these calls or the environment, it may work occassionally, if for example the invalid storage was not needed concurrently.

BTW, is the DB Library up-to-date?

Regards, Alex
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!


It runs

dbproc = dbopen (login, ""); which doesn't return any error then the next line of code is

dbcmd (dbproc, "SELECT column1, column2 from table_a"); which gives the DB-Library Error 10001: NULL DBPROCESS pointer encountered. error

DB Library is SP3.
>>>> dbproc = dbopen (login, "");
can you debug the dbproc? I strongly would assume it goes wrong maybe because of security or network reasons.



How do I debug dbproc?? The DB Library, Database and App are all on the server. I have tried using Names, Localhost info and IP's but still I get the same results. I don't thing it's a 'network' issue
>>>> It runs  dbproc = dbopen (login, "");
Can't you debug the program where that statement was compiled?

I would assume it returns a NULL pointer, hence the errors later. Running the prog in debug mode mostly outputs some DB-Errors in the IDE which might give the explanation why the dbopen failed.

Regards, Alex
Service Pack 4 Resolved the issue

I'm having the same issue, sporadically, using the  same MSSQL Server version.  I performed some tests connecting and running the exact same query a few hundred times in a row, and I started getting the 10001 error once in a while.

We are using ZeosLib using the DB-Library to connect to the server, and at first thought this was the culprit.  But we are now in the process of updating to Service Pack 4 in the hope that it'll solve the issue.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial