Error reading TADOQuery.SQL.Strings "Incorrect arguments"

Hello everybody!

I need your help.
I migrated database application from D2007 to D2009 and when open the project
raise exception "Error reading ADOQuery.SQL.Strings "Incorrect arguments, outside interval or in conflicts with others"

In D2007 all is ok.
The structure table is: 
Fields:
Id: integer;
Name: varchar(30);
total: numeric(15,3);
etc.

The sql commandtext is: update total = :total where id = :id
0
Cesar
12/27/2008 5:06:55 PM
embarcadero.delphi.ado 597 articles. 1 followers. Follow

8 Replies
1072 Views

Similar Articles

[PageSpeed] 13

The sql commandtext should be:

update <mytable> set total = :total where id = :id


Cesar Sanchez wrote:
> I migrated database application from D2007 to D2009 and when open the
> project raise exception "Error reading ADOQuery.SQL.Strings
> "Incorrect arguments, outside interval or in conflicts with others"
>  In D2007 all is ok.
> The structure table is: 
> Fields:
> Id: integer;
> Name: varchar(30);
> total: numeric(15,3);
> etc.
> The sql commandtext is: update total = :total where id = :id
0
Joachim
12/27/2008 8:33:19 PM
> {quote:title=Joachim Uersfeld wrote:}{quote}
> The sql commandtext should be:
> 
> update <mytable> set total = :total where id = :id
> 
> 
> Cesar Sanchez wrote:
> > I migrated database application from D2007 to D2009 and when open the
> > project raise exception "Error reading ADOQuery.SQL.Strings
> > "Incorrect arguments, outside interval or in conflicts with others"
> >  In D2007 all is ok.
> > The structure table is: 
> > Fields:
> > Id: integer;
> > Name: varchar(30);
> > total: numeric(15,3);
> > etc.
> > The sql commandtext is: update total = :total where id = :id

Well, you are rigth...but i was wrong.
The sql commandtext is: update table_name set field_name = :param_name where other_field_name = :other_param_name.

The error continue appear...

Thanks for your reply...
0
Cesar
12/28/2008 4:44:17 PM
I am guessing either Name or Total are reserved words
try putting both field names in side square brackets   [Name]
or try renaming the fields.


> > {quote:title=Joachim Uersfeld wrote:}{quote}
> > The sql commandtext should be:
> > 
> > update <mytable> set total = :total where id = :id
> > 
> > 
> > Cesar Sanchez wrote:
> > > I migrated database application from D2007 to D2009 and when open the
> > > project raise exception "Error reading ADOQuery.SQL.Strings
> > > "Incorrect arguments, outside interval or in conflicts with others"
> > >  In D2007 all is ok.
> > > The structure table is: 
> > > Fields:
> > > Id: integer;
> > > Name: varchar(30);
> > > total: numeric(15,3);
> > > etc.
> > > The sql commandtext is: update total = :total where id = :id
> 
> Well, you are rigth...but i was wrong.
> The sql commandtext is: update table_name set field_name = :param_name where other_field_name = :other_param_name.
> 
> The error continue appear...
> 
> Thanks for your reply...
0
Brian
12/30/2008 12:21:17 AM
> {quote:title=Brian Bushay wrote:}{quote}
> I am guessing either Name or Total are reserved words
> try putting both field names in side square brackets   [Name]
> or try renaming the fields.
> 
> 
I have the problem, D7 and d2007 correct, but D2009 i have the same problem and this names;

precio
importe
cantidad

This structure table is with Fields numerics.

I don't find solution ;-(

Thank you
Regards.
0
rafa
2/3/2009 9:33:45 PM
> > {quote:title=Brian Bushay wrote:}{quote}
> > I am guessing either Name or Total are reserved words
> > try putting both field names in side square brackets   [Name]
> > or try renaming the fields.
> > 
> > 
> I have the problem, D7 and d2007 correct, but D2009 i have the same problem and this names;
> 
> precio
> importe
> cantidad
> 
> This structure table is with Fields numerics.
> 
> I don't find solution ;-(
> 
> Thank you
> Regards.

It may be that the parameters of the query are generated differently.
If you have saved paramters in the IDE I suggest you delete and regerate them
0
Brian
2/4/2009 1:42:54 AM
My project in the Delphi 7, funcionality correct, but Delphi 2009, not;

// Code
  pAdo.Close;
  pAdo.Parameters.Clear;
  pAdo.SQL.Clear;
  texto := 'Insert into TEST ' +
               '   (  IMPORTE ) '+
               ' Values ( :pImporte ) ';

  pAdo.SQL.Add( texto ) ;  // Here CRASH because field IMPORTE is numeric(10,3), but, if i change type field in table by type smallint, ok.

What's the problem ?

Thank you!
Regards
0
rafa
2/4/2009 8:59:21 AM
Is problem version Delphi 2009.
If apply patch update1, it's correct.

Regards
0
rafa
2/4/2009 10:04:48 AM
> {quote:title=rafa carmona wrote:}{quote}
> My project in the Delphi 7, funcionality correct, but Delphi 2009, not;
> 
> // Code
>   pAdo.Close;
>   pAdo.Parameters.Clear;
>   pAdo.SQL.Clear;
>   texto := 'Insert into TEST ' +
>                '   (  IMPORTE ) '+
>                ' Values ( :pImporte ) ';
> 
>   pAdo.SQL.Add( texto ) ;  // Here CRASH because field IMPORTE is numeric(10,3), but, if i change type field in table by type smallint, ok.
> 
> What's the problem ?

Sounds like Delphi isn't correctly determining what the parameter type it creates should be.
You will probably have to manually create your parameters if you don't want to convert your field type to an integer
0
Brian
2/5/2009 2:19:20 AM
Reply:

Similar Artilces:

SQL Server 2005 error: "Incorrect syntax near "-" "
Hello, I have an application written in visual basic which connects to a SQL Server 2005In DB of SQL Server I have many tables. Table names can contain chars like: "-",  "\",  ".", etc. When I execute the instruction in visual basic sTableName= "Table-3" ' or ""Table-3"" or "Table_1" or sTableName= """" + "Table_1" + """"   -> """" = 4 quates (2 for string identify and two for writing in string a quate chr(34)->" strQu...

SQL Server 2005 error: "Invalid object name" / "Incorrect syntax near"
Hi All,This problem isent strictly to do with ASP.NET but I am creating an ASP.NET web application.Just a quick overview, I have recently had to reinstall windows on my machine becuase of an unrelated matter so before I did so i created an SQL script using the SQL Server Database Publishing Wizard so that the SQL Database could be recreated exaclty as it was.I have just reistalled SQL Server 2005 and the Managment Studio and have attempted to run the script.Once the script is run there are literally thousands of the following two errors:Invalid object nameandIncorrect syntax near ...It is ...

pulling out "a","an", "the" from beginning of strings
I need to pull out articles "a", "an", and "the" from the beginning of title strings so that they sort properly in MySQL. What is the best way to accomplish that if I have a single $scalar with the whole title in it? Thanks, Tim -- Tim McGeary tim.mcgeary@lehigh.edu --=-weUphL4mkB1WR5g+DMDc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: > I need to pull out articles "a", "an", and "the" from the beginning of=20 >...

Application Error: The instruction at "0x00000000" referenced memory at "0x00000000". The memory could not be "read".
I've got a weird problem. I'm using PB6.5 to work on an internal application. Everything works fine, and I generated the executable and distributed it in the group. Most of my co-workers could use it without problem, but on one of the machine, whenever I open the MDI Main Frame and try to open a sheet from the menu (any menu item), I got the following error: The instruction at "0x00000000" referenced memory at "0x00000000". The memory could not be "read". Click on OK to terminate the application. Click on CANCEL to dubug the application....

Dynamic Web Part Loading Error: "path" argument cannot be empty if the "type" argument is UserControl
I would like to dynamically load web parts, but without using LoadControl*. However, when I try to use the following code, a runtime error is thrown whose meaning is mostly meaningless to me. Control ctrl = (Control)new MyUserControl(); // Control ctrl = LoadControl( "MyUserControl.ascx" ); ctrl.ID = "DynamicUserControl"; GenericWebPart myWebPart = MyWebPartManager.CreateWebPart(ctrl); MyWebPartManager.AddWebPart( myWebPart, MyWebPartManager.Zones[1], 0 );   The error is thrown on the last line, during AddWebPart:   Additional information: The "path" argument cannot be e...

"SQL Error: Error mapping failed" with Delphi 6 Application and DBExpress
Im using Delphi 6, Firebird 2.x, dbExpress The problem is only with remote database connection and not with local connection. The following connection gives and error Database := MyServer:C:\DEMO.FDB But when locally connected i.e database in the same computer Database := C:\FBdatabases\dbAccounts.FDB Following solution from Firebird forun worked ----------------------------------------- Actually, the issue is inside Borland's DBX driver for InterBase. It's not very much compatible with Firebird. First of all, it uses some internal (metadata) queries in the...

Session in this format["string"]["string"]
Is that possible to have session variable in 2 dimensional array like when we are using Cookie? If so, can you give the syntax in C# please? Thanks.....Best regards,Ron. You can save a 2 dimendional array to a session, however session's are not 2 dimentional. You can: Session.Add("WhatAreNinjas", "Ninjas Are Cool"); and: string[,] astrNinja = new string[2, 2];astrNinja[0, 0] = "doood";astrNinja[0, 1] = "Hurry up and release Team Foundation Server";astrNinja[1, 0] = "ok ok, i know you have to code it, and test it, and all that jazz... but... come on... release it... release iT NOW!";a...

SQL statement failed: (-305) I/O error Fatal error: A disk read from file "SomeDatabase.db" failed with error code: (38)
SQL Anywhere 10.0.1.3831 E. 2009-09-11 21:55:41. SQL statement failed: (-305) I/O error Fatal error: A disk read from file "D:\FHMSL\iFHMS\Data\Feedlot111.db" failed with error code: (38) -- transaction rolled back E. 2009-09-11 21:55:41. Error while executing hook procedure sp_hook_dbmlsync_end. Received this error while running a proc during sync. Tried to validate the db in Sybase Central resulting in the same error. I saw the post at http://groups.google.com/group/sybase.public.sqlanywhere.general/browse_thread/thread/b5d958904160e576?fwc=1 and am wondering if th...

Error during method "CreateMailMessage" from "MailDefinition" object
 Hi, I am having trouble to send E-mail when using maildefinition object. I need to read email body from external txt file, then do some replacements and send it. Only way (what i know - instead of writing my own code), how to get the text  to the body of MailMessage is using the MailDefinition method BodyFileName() When I set everythig up after atempt to send the email I get this error: "The specified string is not in the form required for an e-mail address." I am sure, that the adress i right(it' even valiated throug regularexpretion validator).  Does any b...

What´s the purpose of "classifieds-categories.sql" "classifieds-add.sql""classifieds-remove.sql"?
 Hello all, what´s the purpose of the scripts I enunciated above on the classified starter kit?  "classifieds-categories.sql"  seems to create the initial parent categories, the others 2 names sugest they are used to add and remove ads, but i cant get how.There are 10 types of people in this world:Those who understand binary and those who don't. The classifieds starter kit is ready for upload right out of the box. Any .sql files you find in App_Data are scripts of the database.They are there to make it easy for uploading your site. So if you were not mak...

"Incorrect Format of Input String" Error
Hi!  I have a master page with  a LinkButton navigation menu, setup in a Category and Subcategory fashion.  Each Subcategory has a unique commandName this is used in a script named "BtnNav_OnCommand".  This script uses a "Select Case" to determine what the commandName is and then executes this statement:  Reponse.Redirect("GoToThisPage.aspx?CatID=<selectedCategoryID> SubcategoryID=<selectedSubcategoryID>). The GoToThisPage.aspx.vb code looks like this: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs...

Problem building SQL text query with parameters / "Syntax error converting datetime from character string" error message
Hi folks, I keep looking at these SQL text query and I cannot figure out what I am doing wrong.If I include wrap the dates with quotes, I get the "Syntax error converting datetime from character string" error message, but I don't include them I don't get anything which is also wrong, because there is some data to be displayed. Bottom line, what do you think I am doing wrong when building the SQL query?1 DateTime dateFrom = txtDateFrom.SelectedDate;2 DateTime from = new DateTime(dateFrom.Year, dateFrom.Month, dateFrom.Day, 0, 0, 0);3 ...

Precedence of "where" ("of", "is", "will")?
Nobody on #perl6 today could answer this one. Is: Str | Int where { $_ } the same as: (Str | Int) where { $_ } or: Str | (Int where { $_ }) ? Followup questions, Mr. President: What kind of operators are "where", "of", "is", and "will"? Is there a reason that S03 doesn't list them? What are their precedence(s)? -- Chip Salzenberg - a.k.a. - <chip@pobox.com> Open Source is not an excuse to write fun code then leave the actual work to others. Chip Salzenberg writes: &...

.ALLCOL("%COLUMN%", " ", ", ", ", ")
Do you know anyway for me to exclude a subset of columns returned by this function. We have two columns (rec_user and rec_datetime) which are in all of our tables, but when generating triggers I want automatically generate a script which does not include those two columns but does include all other columns in that table. Bruce I should add that I am using PD 9.0.0.580. Bruce "Bruce Lamb" <lamb.bruce@mayo.edu> wrote in message news:6HgI315nCHA.155@forums.sybase.com... > Do you know anyway for me to exclude a subset of columns returned by this > function. ...

Web resources about - Error reading TADOQuery.SQL.Strings "Incorrect arguments" - embarcadero.delphi.ado

Resources last updated: 12/22/2015 1:23:30 AM