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
8
votes
1 answer

Is there some way in Delphi to cache master-detail rows and post both master and detail child rows at the same time

I want to post in memory some child rows, and then conditionally post them, or don't post them to an underlying SQL database, depending on whether or not a parent row is posted, or not posted. I don't need a full ORM, but maybe just this: User…
Warren P
  • 65,725
  • 40
  • 181
  • 316
8
votes
3 answers

Auto-Recover when DBNETLIB ConnectionWrite General network error causes ADO connections to go offline in Delphi applications?

Googling this ADO error message indicates that it is commonly encountered in ASP.NET development, but I have not found much mention of when it occurs in Delphi applications. We have some customer sites which are experiencing transient network…
Warren P
  • 65,725
  • 40
  • 181
  • 316
7
votes
3 answers

Is there a way to get ADODB to work with Excel for Mac 2011?

I can not seem to get my Excel workbook (using ADODB) to work with Excel Mac 2011. I am using ADODB code. Are there add-ins available? Even from a third-party? Has anyone gotten this to work?
n8gard
  • 1,870
  • 8
  • 26
  • 41
7
votes
2 answers

When do I need to call CoInitialize() in this scenario?

I'm building a multi-threaded windows service application in Delphi XE2 which uses ADO database components to connect to SQL Server. I've used CoInitialize(nil); plenty times before inside threads, but in this case, I have a function which I'm…
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
7
votes
4 answers

Exe Crash At ADODB.Connection with "Class does not support Automation"

One machine having MSVBVM60.dll ver 6.0.97.82, say OLD. Other machine having MSVBVM60.dll ver 6.0.98.15, say NEW. Exe created from NEW machine crashes at line new ADODB.Connection on OLD machine giving following error Run-time error '430': Class…
bjan
  • 2,000
  • 7
  • 32
  • 64
7
votes
2 answers

Using a datetime parameter with ADO (ODBC) loses time part

I stumbled onto this problem yesterday when I was busy writing some unit tests using SQLLite. My environment is Windows7/Delphi XE. Using TADOQuery in conjunction with a TDateTime parameter results in loss of the time part. unit…
whosrdaddy
  • 11,720
  • 4
  • 50
  • 99
7
votes
3 answers

ADO SQL type cast Float to String (Excel)

How do I use the CAST in ADO to convert Float values to String? I tried SELECT CAST([Field] AS VARCHAR(20)) FROM ... and SELECT CAST([Field] AS STRING) FROM ... and always get an OLE Exception (Unknown error). The table column contains mixed…
mjn
  • 36,362
  • 28
  • 176
  • 378
7
votes
4 answers

Using Autonumbering in Access - INSERT statements

I'm having trouble running an INSERT statement where there's an autonumber as the PK field. I have an Auto-incrementing long as the Primary Key, and then 4 fields of type double; and yet Access (using ADO) seems to want five values for the insert…
Smashery
  • 57,848
  • 30
  • 97
  • 128
7
votes
2 answers

TADOQuery - Edit mode inserts new record rather than editing

I'm puzzled at the behavior of the TADOQuery, let's just call Q. When I use Q.Edit, populate some fields, then Post, it ends up actually inserting a new record. The code is simple, and reading the ID from an object: Q.SQL.Text := 'select * from…
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
7
votes
1 answer

How to parameterize 12/30/1899 to SQL Server native client when DataTypeCompatility is on?

Short Version Trying to pass the datetime value 12/30/1899 to SQL Server, fails with Invalid date format - but only for the native client drivers, and only in DataTypeCompatiblity mode. Long Version When trying to use parameterized queries in ADO,…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
7
votes
3 answers

How to run a database script file from Delphi?

I want to do the following. 1) Create a database. 2) Run a script when creates tables, stored procedures, etc. (this script is created by SMS 'generate scripts' option) I found the following code: …
Rob
  • 2,363
  • 7
  • 36
  • 54
7
votes
3 answers

How to check all fields of the recordset from ADO query?

I would like to see if there is a command to show the whole record(row) at once. By now I only find method to show individual columns. I am using a ADO connection to the ms access's mdb. Thanks. By the way, I don't know how can I print a message in…
lamwaiman1988
  • 3,729
  • 15
  • 55
  • 87
7
votes
3 answers

ADO components CommandTimeout

I have a problem with settings of the query execution timeout with TADOQuery, TADOCommand or TADODataSet (I've tried it with each one). I have a tiny application, which connects to the database and periodically executes stored procedures, which…
user532231
7
votes
2 answers

Unable to pass empty string into non-null database field

I'm stumped on something which should be very straight-forward. I have a SQL Server database, and I'm trying to update a non-nullable varchar or nvarchar field with an empty string. I know it's possible, because an empty string '' is not the same…
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
7
votes
4 answers

Classic ASP 3.0 Create Array from a Recordset

I'm trying to fix an ASP Classic app and when I try to create an array from a Recordset Object. However I Can't get it to work correctly. This code gives me a single record (the last one), but as far as I can see it is correct: Dim Products Dim…
John Swaringen
  • 731
  • 4
  • 11
  • 29