Hello!
I create 14 parameters like the 1 line of code below  in my form's constructor.
   MyQuery_Site_ID->Params->CreateParam(ftInteger, "pram_ut", ptInput);
In another section of code when a user pushes a button I have this code.
   Form1->MyQuery_Site_ID->ParamByName("pram_ut")->AsInteger = Form1->MyTable_Version_Utility->RecordCount -2;
After this line of code I generate a very long SQL statement which depends on what the user selects (many checkboxes).
The SQL statement works the first time...but then when I try a second time the SQL statement I generate raises a exception that says:
Project Site_Tracker.exe raised exception class EDatabaseError with message 'Parameter 'pram_ut' not found'.  Prcess stopped. Use Step or Run to continue.
Why does this happen?
Does the params property flush out the old params that were created in it when a SQL statement is run in my query?
Also question #2.
When you highlight a TMyQuery object in the design mode...is there any reason why you can't put parameters in the dialog box that pops up?  (All the controls on the parameters tab are disabled)
---Dave
			
									
									
						Param question
MyQuery parses statement you assign to SQL property and creates parameters automatically. After SQL statement with parameters is set you can access these parameters in both run time (ParamByName) and design time (parameter editor). To prevent automatic parameters recreation you should set ParamCheck option to False.
			
									
									
						- 
				Guest