08-29-2019 03:42 PM
I am trying to using the Automatic SQL maps to read data from two tables in an SQL Database.
In Function One, I open a connect to the database, map database columns to program variables, activate the map pointing to Table 1, fetch the records, deactivate the map, and close the database connection.
In Function Two, I open a connect to the database, map database columns to program variables, activate the map pointing to Table 2, fetch the records, deactivate the map, and close the database connection.
They code is very similar. If I run Function One first, Function Two fails. If I run Function Two first, Function One fails. The error I get is
Database Error #-94.
Command was DBFetchNext(iMapHandle = 2).
Error Message = Invalid statement or connection handle.
I have try leaving the database connection open for both functions and still get the same error. Even in with all this mess, I can still write data to a third table
Paul
Solved! Go to Solution.
09-04-2019 10:54 AM
Hi Paul,
Can you post your code as well here? I think this might be helpful for debugging this.
Best,
09-04-2019 11:11 AM
Claire,
It was Operator error. I was stomping on the variable to the database connection, so the second function did not have a correct database connection. Once I fixed the error, both functions work.
Paul
09-04-2019 11:34 AM
Hi Paul,
Glad you were able to fix it! Best of luck on the rest of the project.
Best,