Questions tagged [tadoquery]

119 questions
3
votes
1 answer

ADO Query treats goto labels as parameters

I'm facing an issue executing SQL script in a TADOQuery component. The script that's being executed has goto statements along with their corresponding labels, for example: goto MyLabel MyLabel: --do something else However, the TADOQuery is…
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
3
votes
1 answer

Return code of doing an update query with ADOquery in Delphi to PostgreSQL

I'm using Adoquery with a Postgres database. When I do an UPDATE or INSERT query the ExecSql nor the OPEN returns the number of affected records as it should , but always -1. I use the newest version of psqlODBC :…
3
votes
1 answer

How to add multiple lines from a TMemo component to a MS Access database?

I got an ADO Database with a table named t_codemeaning, below are the table structure : t_codemeaning codemenaing_code AS Text codemenaing_title AS Text codemenaing_description AS Text I add all of table in my ADOQuery1. I click a button…
Galvion
  • 1,353
  • 7
  • 23
  • 35
3
votes
3 answers

Delphi - TADOQuery.RowsAffected always -1 with UPDATE SQL statement

I'm executing a SQL UPDATE statement using a TADOQuery component and want to inspect the number of rows that were updated. The UPDATE statement is executing fine and the rows are modified accordingly but the .RowsAffected property always returns…
Jonathan Wareham
  • 3,357
  • 7
  • 46
  • 82
2
votes
3 answers

What are the "Missing SQL property" here?

When trying to execute the code: function TDBClass.addNome(nome: String): String; var rsnome: TADOQuery; begin rsnome := TADOQuery.Create(nil); rsnome.Connection := connection; rsnome.Open(); rsnome.SQL.Clear; rsnome.SQL.Text:='UPDATE…
Albert E. Souza
  • 116
  • 2
  • 12
2
votes
1 answer

Is there a way to know if TAdoQuery in Edit state was changed?

Is there a way to know if TAdoQuery in Edit state was changed? Assuming we forced it into edit state, and we want to ask the user if he wants to keep the changes.
none
  • 4,669
  • 14
  • 62
  • 102
2
votes
1 answer

How do I use TADOQuery.Parameters with integer parameter types that have to be put in two or more places in a query?

I have a complex query that contains more than one place where the same primary key value must be substituted. It looks like this: select Foo.Id, Foo.BearBaitId, Foo.LinkType, Foo.BugId, Foo.GooNum, …
Warren P
  • 65,725
  • 40
  • 181
  • 316
2
votes
1 answer

ADOQuery Get Result (Delphi)

I Tried to get result from ADOQuery in Delphi. I wrote this function for Get a Name from table according custom ID. function GetNameByID(Id : Integer) : string; var query : string; Begin ShowMessage(GetDBGridViewIndex().ToString); query :=…
Behdadsoft
  • 77
  • 9
2
votes
1 answer

TADOQuery SQL.add() submitting/preparing the sql

Overview: I have written an application that allows a user to define a query, submit it to a server and view the results. The software can run on DB2 or MySQL. Problem: We've had issues in the DB2 version where a user has tried to run a query, and…
Jeedee
  • 548
  • 5
  • 24
2
votes
1 answer

Can't get Delphi ADOQuery to update or insert into Excel Worksheet

I am currently working on a program which function is to read data from a Excel Spreadsheet, where the user should be able to edit the amount of stock and generate a separate report of only stock used, this I have done. My problem occurs when trying…
Zorog
  • 33
  • 5
2
votes
0 answers

ADO: Insert Geometry Data to SQL DB

Is there a posibility to insert Spatial Instances to SQLDB by using Parameters. In my case I use TADOQuery (AQuery) with TADOConnection(AConnection). My Table consists of two columns Geom: geometry and ObjectName: varchar(50) How can I correctly…
Jacks
  • 67
  • 5
2
votes
4 answers

Get last row data after insert into using Delphi AdoQuery

In Delphi 2007 using ADOQuery when i add a row into a table using insert into how do i get last row? i'm adding row with this. QD_TEMP1.close; QD_TEMP1.sql.Clear; QD_TEMP1.SQL.Add('insert into s_hasta_Kabul…
TheMuyu
  • 579
  • 2
  • 12
  • 31
2
votes
1 answer

Delphi TADOQuery Select top N

I am trying to select only the top N items in a TADOQuery, but it gives me and error when I activate the query. It seems to find the top parameter just fine, but fails to replace it when executing. If I don't limit the SQL statement with "Top N"…
runfastman
  • 927
  • 2
  • 11
  • 31
2
votes
2 answers

Using ParseSQL Command for ADO Parameters Cause Invalid Parameter DataType

I have some SQL Command that contains a parameter such:(Note that myID has "int" type in SQL) vSqlString :='Select * From myTable Where myID= :paramID'; and Use ParseSQL Command to execute this command: myADOQuery.Parameters.ParseSQL(vSqlString ,…
Mohammad Gohari
  • 241
  • 3
  • 12
2
votes
3 answers

TAdoquery date format

I am Java developer. I have some old program in Delphi. In old version they work with mdb. I fixed it for connection with SQL Server. All SQL queries are implemented with TAdoQuery. qryTemp.SQL.Text:='select …
Rinat Mukhamedgaliev
  • 5,401
  • 8
  • 41
  • 59