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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: 'Parameter object is improperly defined' 1

Status
Not open for further replies.

AP81

Programmer
Apr 11, 2003
740
AU
I have a mySQL database with a Delphi front end application. I use an ADO connection to access the database.

The database holds about 15,000 lines. Eveything works OK, except for one record.

When I try to insert the record, I get the following error message:

EOleException - "Parameter object is improperly defined. Inconsistent or incomplete information was provided."

Now, I tried re-inserting the record into the database (through my application) and found that the error came down to one line:

Code:
Payment can be deposited into the following account:

If I remove the colon, it will insert OK. If I put the colon back, it raises the exception again. However, if i add that line to any other record it inserts fine, so there is no problem with the text itself.

If I insert the information into the database (directly through command line) there is no problem, so I am guessing that it is an ADO problem.

I have also tried changing the data type from VARCHAR to TEXT, but it didn't solve the problem.

Can anyone help me?




------------------------------------
There's no place like 127.0.0.1
------------------------------------
 
ap81:
i have run into same problem, i believe. i am able to insert a rec via MS Query Analyzer, but the same INSERT executed programmatically fails, just like yours.

at first i throught the colon was a SQL special/reserved character, but my dba said 'not so'. then our senior delphi guys hit on something: that the colon DOES mean something to Delphi, namely it marks dynamic parameter(s) in a SQL statement.

POSSIBLE ANSWER: TADOQuery (and other ADO classes?) have a prop called ParamCheck, which is True by fault. in code, i have toggled it to False, meaning Delphi/ADO will not hunt through my SQL statement looking for params, real or perceived. SO FAR, this is working for me. see snippet below for context here. hope this helps.

qryInsert := TADOQuery.Create(nil);
qryInsert.Connection := fDM.connStaging;
qryInsert.ParamCheck := false;
qryInsert.SQL.Add(fsCompleteInsertStmnt);
iSQLResult := qryInsert.ExecSQL;
 
Thanks for the help. I have migrated all my code to directSQL, which works a lot better than ADO. That simple parameter check is what probably caused the problem.




------------------------------------
There's no place like 127.0.0.1
------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top