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

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

Question:

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?

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