This is sort of a repeat question from yesterday. Sorry, but I am really stumped.
I am using the following code that is inside of a procedure that is being called by a button on a form:
STORE SQLCONNECT('db_data') TO gnConnHandle
SQLEXEC(gnConnHandle, str_sql, 'MyCursor')
SQLDISCONNECT(gnConnHandle)
//db_data is my generic text FoxPro database.
//str_sql is my Characeter String Variable with my SQL statement.
It worked fine until I added a comment below it. Then I got a "Connection handle is invalid" error. By someone's suggestion yesterday, I changed the SQLCONNECT command to be SQLCONNECT('db_data', 'sa', "". Again, it worked fine at first. So just to test it, I put a blank line in the code and I got the same error. I also tried giving the full path of db_data and got the same result.
I am wondering if I am not properly executing or closing this connection. It seams very strange that the code fails to work once I add anything else.
Any Advice?
I am using the following code that is inside of a procedure that is being called by a button on a form:
STORE SQLCONNECT('db_data') TO gnConnHandle
SQLEXEC(gnConnHandle, str_sql, 'MyCursor')
SQLDISCONNECT(gnConnHandle)
//db_data is my generic text FoxPro database.
//str_sql is my Characeter String Variable with my SQL statement.
It worked fine until I added a comment below it. Then I got a "Connection handle is invalid" error. By someone's suggestion yesterday, I changed the SQLCONNECT command to be SQLCONNECT('db_data', 'sa', "". Again, it worked fine at first. So just to test it, I put a blank line in the code and I got the same error. I also tried giving the full path of db_data and got the same result.
I am wondering if I am not properly executing or closing this connection. It seams very strange that the code fails to work once I add anything else.
Any Advice?