WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ODBC
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

ODBC Extender with WebBatch problems

Keywords:      qConnect error ODBC

Question:

I have been trying to use the ODBC Extender with WebBatch 98D and MS Peer Web Services. When I issue the qConnect function from within my WebBatch script the function fails. If I extract all of the WinBatch from this script and execute this outside of the browser environment (i.e. just WinBatch) I get a successful connection. I have checked items such as the DSN and the ODBC dlls are available for the IUSR_machinename account that the PWS WWW service uses but still have had no success.

The qConnect function fails with a return error of -1 (SQL_ERROR).

I have run out of ideas now, can anybody help?

Answer:

One option is to try to capture the error. For example:
ErrorMode(@OFF)

retcode = qConnect(hdbc, Datasource, "", "") 

ErrorMode(@CANCEL)

err=qerror(hdbc,1)

webout(err,1)


If (retcode != @qSuccess) && (retcode != @qSuccessInfo)

  Message("qConnect failed", retcode)

  Exit

Endif

The error message returned from the driver, should clear things up.

Reply to Answer:

I have spotted the problem now. The qError function finally helped me track this down.

As part of the profile for the IUSR_machinename account I was including a folder in the PATH environment containing the DLLs required for the DB connection. It seems that the profile definitions are not used when the account is only providing the 'service logon' requirement. I even tried including this folder in the machine PATH environment, which still made no difference. As soon as I put the DLLs in the system32 folder all was well.


Article ID:   W12540
Filename:   ODBC Extender with WebBatch problems.txt
File Created: 2001:01:09:15:56:46
Last Updated: 2001:01:09:15:56:46