Questions tagged [ado]

Microsoft ActiveX Data Objects (ADO) is a COM based package for accessing databases such as SQL Server or data sources such as Excel spreadsheets. ADO.NET provides improvements over ADO along with integration with the .NET Framework for .NET developers. ADO.NET tag should be used for ADO.NET specific questions.

Microsoft developed ADO as a set of COM objects providing a middleware between an application and ODBC for accessing data sources. With ADO, the programmer has a more generic interface to database engines such as SQL Server as well as to other data sources such as Excel spreadsheets.

ADO provides a set of COM objects which a programmer can instantiate and then use for particular data source accesses. Being COM objects, ADO can be used with a variety of programming languages. The ADO interface allows SQL statements to be passed to a data source that supports SQL.

ADO contains 4 collections and 12 objects.

ADO.NET is a replacement for ADO in the .NET Framework.

Links:

References:

2633 questions
9
votes
1 answer

Requested operation requires an OLE DB Session object... - Connecting Excel to SQL server via ADO

I'm attempting to take Excel 2003 and connect it to SQL Server 2000 to run a few dynamicly generated SQL Queries which ultimately filling certain cells. I'm attempting to do this via VBA via ADO (I've tried 2.8 to 2.0) but I'm getting an error…
Frank V
  • 25,141
  • 34
  • 106
  • 144
9
votes
2 answers

Retrieve ADO Recordset Field names (Classic ASP)

I wonder if someone can help: Long story short, I'm using MSSQL2005 to build a Pivot table. The data being examined is limited by date range (All data for 1 week starting from the nearest Monday to the date selected) When I run the Stored Proc and…
Basic
  • 26,321
  • 24
  • 115
  • 201
9
votes
1 answer

How to get the table name from a field in a join query with MSSQL? (mysql_field_table equivalent)

I'm doing a query manager in Delphi using ADO, I need to know all fields that will be returned by a query, does no matter how complex and how much joins they will have. I want to call a function, that return to me, all fields that will be returned…
user2092868
  • 273
  • 3
  • 18
9
votes
1 answer

How to update a DateTime on SQL Server preserving milliseconds using Delphi 7 ADOQuery.ExecSQL?

How do you update a DateTime on SQL Server 2012 preserving milliseconds using Delphi 7 ADOQuery.ExecSQL? SQL server seems to drop the seconds precision so I do not have milliseconds or microseconds on a SQL Server 2012 DateTime2[7] field. MS Access…
user610064
  • 481
  • 2
  • 11
  • 25
8
votes
9 answers

Getting "Multiple-step operation generated errors. Check each status value." error using ADO with SQL server 2008

We are in the process to migrate our SQL 2000 box to SQL 2008. But we ran into an issue; when a result set (rows or not) is returned by using a query that has a UNION. Later in the code we try to add a new row and assign field to it but because a…
vocero
  • 186
  • 1
  • 4
  • 10
8
votes
2 answers

Get the list of ODBC data source names programmatically using Delphi

I saw several examples where the list of the source names were took from registry (HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\ODBC Data Sources). Is there any other way to get the list of ODBC data sources names? I need to work only with Delphi…
RBA
  • 12,337
  • 16
  • 79
  • 126
8
votes
5 answers

ADODB open recordset fails / "Operation is not allowed when object is closed"

I have the following UDF in excel which uses ADO to connect to my MSSQL server. There it should execute the scalar udf "D100601RVDATABearingAllow". For some reason the parameters that I try to append are not send to the sql server. At the server…
Lumpi
  • 2,697
  • 5
  • 38
  • 47
8
votes
3 answers

VB6 CALC Aggregation on ADO Shape when returns Null getting General Error in Data Report

I am using ado shape command on my data report, it works fine but when my aggregate function CALC(agrProfit/agrExtended*100) is null or 0/0*100 it shows general error and data report not showing up. Please Help. mRS.Open "SHAPE {select…
FatalError
  • 219
  • 5
  • 20
8
votes
8 answers

How to prevent Delphi ADO from loading the entire table into memory?

I am not a Delphi programmer, but I I got an old Delphi 7 application that I need to fix and it is using ADO. The database table (MS Accesss) contains +100,000 rows and when I set the ADOTable.Active=true it starts to load the entire table into RAM…
Andy
  • 228
  • 1
  • 2
  • 11
8
votes
1 answer

How to disconnect an ADO Recordset in XE6?

I am trying to use a disconnected ADO Recordset in XE6. The idea is that you open the recordset normally, then you set the recordset's ActiveConnection to your language's equivalent of null/Nothing/nil: rs.Set_ActiveConnection(null); The following…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
8
votes
6 answers

Multiple rows with a single INSERT in SQLServer 2008

I am testing the speed of inserting multiple rows with a single INSERT statement. For example: INSERT INTO [MyTable] VALUES (5, 'dog'), (6, 'cat'), (3, 'fish) This is very fast until I pass 50 rows on a single statement, then the speed drops…
Todd
  • 81
  • 3
8
votes
6 answers

Delphi ADO Query

Is there any faster way to iterate through an ADO Dataset than while (not ADOQuery1.Eof) do begin /* Do something */ ADOQuery1.Next; end; I need to scan a dataset of around 9000 items and only extract records matching a…
Pieter van Wyk
  • 2,316
  • 9
  • 48
  • 65
8
votes
1 answer

Classic ASP - ADO execute Stored Procedure passing in parameters

I am needing to pass parameters into a stored procedure with Classic ASP. I do see some people using the Command object and others NOT using it. My sproc params are like this: @RECORD_NUMBER decimal(18,0), @ErrorType nvarchar(100), @INSURANCE_CODE…
user3183930
8
votes
1 answer

How to get the affected rows in VBA ADO Execute?

The following code errors on the MsgBox cn.RecordsAffected line with: Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. How can I successfully get the affected number of rows? This is for an Access…
Danny Beckett
  • 20,529
  • 24
  • 107
  • 134
8
votes
4 answers

A better way of passing parameters to a TADOStoredProc (Delphi)

I am needing to convert a large amount of SQL queries into stored procedures. I have some code that updates about 20 or 30 values at one time in one Delphi procedure. I can handle creating a stored procedures to do such a thing. The problem is my…
Earlz
  • 62,085
  • 98
  • 303
  • 499