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.

More Explanation on how the ODBC Extender Works

Keywords:	 ODBC extender	 memory

Question:

When executing the qFreeStmt and qFreeConnect functions, I'm getting a memory error, "Memory could not be written." Why is this happening?

Answer:

Try using the qDisconnect function instead of the qFreeStmt and qFreeConnect functions, and see if that fixes it.

Here's some background on how the ODBC extender works:

When you allocate an environment handle, Winbatch allocates memory and a logical cursor/pointer position, from a table that's loaded in memory.

You cannot reuse the Statement Handle when the cursor is in use in this memory table.

When this process is going on, there are still pending results (going on in memory).

Therefore, if you do an unbind when the cursor is still processing, you can get a GPF or memory error. This is because various other resources are still connected to the statement handle.

When Winbatch frees the statement handle, we disconnect and *then* free the connection handle.

We drop all statement handles after this, and discard all pending rows. So if you're still in the middle of processing (i.e., your pointer is still going through the rows), you could get a GPF error.

If you really want to free the statement handle, then you should use the qDisconnect function, which handles everything and kills it completely, thereby discarding all pending rows and handles.


Article ID:   W12536
Filename:   More on How ODBC Works.txt
File Created: 1999:04:15:16:47:54
Last Updated: 1999:04:15:16:47:54