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.


Error Messages

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


I have been trying to use the ODBC Extender with WebBatch 98D and MS Peer Web Services. Although WebBatch functions poperly in every other way, 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?


One option is to try to capture the error. For example:

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




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

  Message("qConnect failed", retcode)



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:   W12467
Filename:   ODBC Extender with WebBatch problems.txt
File Created: 2017:07:28:13:58:11
Last Updated: 1999:04:15:16:47:26