It looks as if you are trying to pull data from the results log after the script runs. Then report what the script did. The propblem is that the result file is not created until after the script stops running so this wont work unless you start another QTP script which analysis the first one.
I would write a function in my QTP Function Library that makes this SQL call. Pass in whatever parameters you need to construct your SQL statement to update the DB with the test case and the values you need to set (pass/fail, etc.). Then call this function after each step in your QTP script where a test case is validated. This means stop using checkpoints (if you are using them) and start writing your own. It would look a little like this:
myVal = Browser(X).Page(Y).Object(Z).GetROProperty("innert ext") 'or whatever property you care about
If myVal = SomeExpectedValue Then
Reporter.reportevent micPass, "Test summary", "Test description"
Call DbReportFunction 'with pass values
Reporter.reportevent micFail, "Test summary", "Test description"
Call DbReportFunction ' with fail valjues
Now you use a homemade checkpoint like that for everything in your script that you need to test.
And if you feel a little ambitious, you can write your own homemade function to replace the Reporter.ReportEvent functionality so that it can do everything for you - report the test results AND call your SQL statement, all in one function.
And then for extra credit, write a whole new function that actually does the test for you. You send it an object description and a property, and it does everything I coded above. It gets the property, tests against expected results (you pass the expected result as a function parameter), reports the pass/fail, and makes the DB SQL call - all in one handy function so that you only need to insert one line of code into your script each time you want to test something.
"The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"