Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TQuery memory access violation

Status
Not open for further replies.

rjbalicki

Programmer
Jan 30, 2001
28
0
0
US
My tquery.unprepare statement crashes my program. My order of operations is this:

1. create
2. databasename:='database'
3. sql.add
4. prepare
4. open
5. Loop until eof
6. close
7. unprepare (blows up here)
8. free (never gets here)

Does anyone know of a reason why this may happen? I have other querys that use the same logic in this program and they all work alright. The only thing I'm doing different is passing the self object from the procedure to the function containing the code I'm referencing as a TComponent and using this TComponent parameter in the create statement. Any help would be great!
 
Just to make a test:
pass "nil" when creating the Query. It may be that the component you're passing as the owner is being destoyed somewhere else in the program so destroying its children also.
Hope it helps,

Alphonsus.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top