Questions tagged [adodb]
ActiveX Data Objects, a Microsoft middleware for accessing data sources. Allows to access data from various languages without knowing how the database is implemented. Successor of RDO (Remote Data Objects) and DAO (Data Access Objects), first introduced in 1996.
adodb
1,851
questions
61
votes
7
answers
137k
views
How do I run a VBScript in 32-bit mode on a 64-bit machine?
I have a text file that ends with .vbs that I have written the following in:
Set Conn = CreateObject("ADODB.Connection")
Conn.Provider = "Microsoft.ACE.OLEDB.12.0"
Conn.Properties("Data Source") = "C:...
48
votes
2
answers
55k
views
What is difference in adodb and oledb?
What is the difference between adodb and oledb?
What is the relation between these two?
Where does ado.net stands in context of adodb and oledb?
28
votes
6
answers
47k
views
ADODBCould not load type 'ADODB.FieldsToInternalFieldsMarshaler' from assembly
I'm trying to read an ADOBD.Recordset object like this (my first time, so pardon my "noobness" :D):
Presentation.Category categorySvc = new Presentation.Category();
ADODB.Recordset categories = ...
28
votes
6
answers
197k
views
Accessing SQL Database in Excel-VBA
I am copying an VBA code snippet from MSDN that shows me how to grab results from a SQL query into excel sheet (Excel 2007):
Sub GetDataFromADO()
'Declare variables'
Set objMyConn = New ...
21
votes
3
answers
105k
views
ADODB query timeout
I am trying to open a query, which is timing out. I have tried setting the timeout property, but it doesn't seem to want to accept it.
The query takes 34 seconds to execute using MS-SQL Server ...
16
votes
2
answers
56k
views
Finding The DSN To My Database?
I have an SQL database and want to connect to it using VBA in order to support some legacy functionality. I'm using an ADODB connection and need to know what my database DSN is. How can I find this? ...
15
votes
7
answers
84k
views
VBScript & Access MDB - 800A0E7A - "Provider cannot be found. It may not be properly installed"
I've having a problem with a VBScript connecting to an access MDB Database. My platform is Vista64, but the majority of resources out there are for ASP/IIS7.
Quite simply, I can't get it to connect. ...
15
votes
1
answer
13k
views
Deep Copy or Clone an ADODB recordset in VBA
I have been searching for a way of duplicating or copying a recordset in VBA. And by that I mean, having the undelying data independent of each other.
I have tried
Set copyRS = origRS.Clone
Set ...
14
votes
13
answers
81k
views
VB6 ADODB.Recordset RecordCount property always returns -1
I am trying to get some old VB6 code to work with SQL Server Compact.
I can connect, open the database and all seems well. I can run insert select commands which work.
However the ADODB....
12
votes
4
answers
93k
views
Excel VBA - connect to sql with a trusted connection (no uid/pwd)
Is there a way to have Excel connect to Sql Server using the current user's network windows authentication (trusted connection/integrated security)? I don't want to rely on a sql login or have a uid/...
12
votes
3
answers
13k
views
Running multiple async queries with ADODB - callbacks not always firing
I have an Excel workbook that fires three queries to a database to populate three tables on hidden sheets, and then runs three 'refresh' scripts to pull this data through to three visible presentation ...
12
votes
4
answers
15k
views
Is it necessary to close an ADODB.Recordset object before setting it to nothing?
Dim rs as ADODB.Recordset
set rs = ReturnARecordset 'assume ReturnARecordset does just that...
'do something with rs
rs.Close
set rs = Nothing
Is it necessary to call rs.Close before setting it to ...
11
votes
4
answers
32k
views
Specify a default driver for ODBC
I have a legacy VB6 app which builds a DSN based on a parameter in a config file. The parameter is an ODBC connection, and the connection has a name (DSN-NAME) which maps a server (DBSERVER) to a ...
10
votes
6
answers
19k
views
'Type Mismatch' Error on ADODB.Recordset
I have a program that is supposed to read data from an SQL database and report back to Excel. It works as expected on a 32-bit machine, but since I moved over to a 64-bit work environment, the program ...
10
votes
6
answers
36k
views
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered in the local machine [closed]
I'm getting this error when trying to run a vb application on a another pc. Is there some place I can download this DLL?
10
votes
3
answers
80k
views
Using SQLDataReader instead of recordset
I am new to this and had this question. Can I use SQLDataReader instead of a Recordset. I want to achieve the following result in an SQLDataReader.
Dim dbConn As New ADODB.Connection
Dim rs As New ...
10
votes
1
answer
13k
views
VB6 application ado connection for TLS1.2
I have to support a VB6 application that is still in production (ugh). A customer is specifying our software needs to be PCI compliant which requires TLS 1.2.
Anyone know how to do this?
I am using ...
10
votes
2
answers
3k
views
Why can't I do a "with x as (...)" with ADODB and Oracle?
I fail to execute an SQL query with a with clause via ADODB and Oracle.
That is, the following snippet works:
Dim cn As ADODB.connection
Set cn = ....
Dim rs As ADODB.recordSet
Set rs = New ADODB....
10
votes
2
answers
6k
views
SQL injections in ADOdb and general website security
I have done pretty much reading and still don't understand 100% how some of the SQL injections happen!
I'd like to see, from those who know, concrete examples of SQL injection based on my example, so ...
10
votes
2
answers
6k
views
Setting CursorType with ADODB.Command.Execute
Is there any way to set the CursorType for an ADODB.RecordSet which I obtain from ADODB.Command.Execute?
I know that it is possible if I do:
rs = Server.CreateObject("ADODB.RecordSet")
rs.Open(cmd)
...
9
votes
1
answer
23k
views
Is adodb.dll included in a .NET distribution?
I was troubleshooting an issue on a customer's workstation and found that, to my surprise, adodb.dll was nowhere to be found on the customer's workstation.
Typically, I see the file in C:\Program ...
9
votes
2
answers
20k
views
sql join on string = integer to work on any RDBMS
I need to join two tables on column, which in one table is defined as string and in other as integer. In both columns actual data stored is integers. This is given to me by design - I can't change ...
9
votes
4
answers
13k
views
Excel table loses number formats when data is copied from ADODB recordset
I'm updating an excel table from an ADODB recordset using the CopyFromRecordset method.
After the update, the numbers show up as dates wherever there are number columns.
The workaround I used ...
9
votes
3
answers
10k
views
Passing current ADO Record to another function
Perhaps I've spent too much time in .NET, but it seems odd that I cannot easily pass the current Record of an ADO RecordSet to another method.
Private Sub ProcessData(data As ADODB.Recordset)
...
9
votes
4
answers
23k
views
ASP Classic check for database NULL value in Recordset
I'm getting an ADODB Recordset and I need to check the value of a nullable column in ASP Classic. How can I tell whether it's null? AFAIK IsDBNull doesn't exist in ASP Classic, and all the Null ...
8
votes
3
answers
38k
views
ADODB connection from VBA stopped working
We've got an Exccel spreadsheet used to manage the rota for the out of hours support engineers. A while back, I added a bit of VBA code which automatically diverts the support phone numbers to the ...
8
votes
5
answers
15k
views
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 ...
8
votes
1
answer
16k
views
Could not load type 'ADODB.FieldsToInternalFieldsMarshaler' from assembly
I have the following code:
MAPITable mt = rStores.MAPITable;
Recordset rs = new Recordset();
rs = mt.ExecSQL(@"SELECT EntryID, ""http://schemas.microsoft.com/mapi/proptag/0x0FF60102""...
8
votes
6
answers
89k
views
How to populate a ComboBox with a Recordset using VBA
There is some literature available at expert's exchange and at teck republic about using the combobox.recordset property to populate a combobox in an Access form.
These controls are usually ...
8
votes
4
answers
1k
views
VBA to Prevent Keyboard Input While a Package Object (XML) is Read into ADODB Stream?
I am developing an application which opens and reads an XML document previously embedded in a PowerPoint presentation, or a Word document. In order to read this object (xmlFile as Object) I have to ...
7
votes
2
answers
14k
views
How to set "Application Name" in ADODB connection string
In .NET I simply use Application Name = MyApp inside the connection string, but when using ADO connection through VBA the Activity Monitor of the SQL Server Management Studio always shows Microsoft ...
7
votes
1
answer
22k
views
Calling SQL Stored Procedure with Output Parameter in VBScript
I've written a VBScript function to call a stored procedure. In the past, I've written a number of functions calling stored procedures with input parameters, but in this instance, I need to work with ...
7
votes
4
answers
18k
views
"Invalid use of Null" when using Str() with a Null Recordset field, but Str(Null) works fine
I'm banging my head against the wall on this one. I was looking at some old database reporting code written in VB6 and came across this line (the code is moving data from a "source" database into a ...
7
votes
2
answers
5k
views
Reading and working with strings longer than 255 with ADODB Excel 2010 VBA
Here' a thing for you guys:
I want to read information from from a closed workbook using ADODB in VBA EXCEL.
It happens that the strings in the cells in excel sometimes are with a length bigger than ...
7
votes
2
answers
4k
views
How to resume/retry a broken TADOConnection across the application?
I have a data module with a global TADOConnection (with the default KeepConnection set the true).
There are numerous datasets and queries in my existing application that use this global ...
6
votes
3
answers
41k
views
VBA - Create ADODB.Recordset from the contents of a spreadsheet
I am working on an Excel application that queries a SQL database. The queries can take a long time to run (20-40 min). If I've miss-coded something it can take a long time to error or reach a break ...
6
votes
4
answers
9k
views
Using "SELECT SCOPE_IDENTITY()" in ADODB Recordset
Using a VBA script in Excel, I'm trying to insert a new row into a table and then get back the identity value of that row. If I run:
INSERT INTO DataSheet(databaseUserID, currentTimestamp)
VALUES (1, ...
6
votes
1
answer
32k
views
ADODB doesn't exist in Access 2013 project, how do I add a reference to it
I am trying to rebuild an Access adp project in Access 2013 as and mdb. The tables are all linked tables in both version so that is not an issue.
I have imported the forms from the old project so the ...
6
votes
1
answer
14k
views
Adding TEXT parameters to ADODB.Command without using stored procedures
I need to perform INSERTs on a SQL Server 2008 table with some TEXT columns, and I can't have the ADODB.Command parameter for the TEXT column working.
The table is defined as:
CREATE TABLE dbo.Test (...
6
votes
2
answers
206
views
Rare Incident when setting dates range in where of a query of MySql?
I'm programming Classic ASP against a MySql Database connecting with ADODB and MySQL ODBC 5.3 ANSI Driver, but I have some problems when setting the date in the where of a simple MySql query, when my ...
6
votes
2
answers
12k
views
ADODB.Parameters error '800a0e7c' Parameter object is improperly defined. Inconsistent or incomplete information was provided
I'm primarily an PHP developer, but I have some old ASP one of our previous developers made that broke and I can't figure out how to fix it. We have a program that sends some variables to a listener ...
6
votes
1
answer
5k
views
Return a value and a result set from stored procedure classic asp
I want to get both a return code and a result set back from a stored procedure in classic ASP.
CREATE PROCEDURE CheckEmployeeId
@EmployeeName nvarchar(255)
AS
BEGIN
SET NOCOUNT ON;
DECLARE
...
6
votes
1
answer
9k
views
Use Table name in SQL query in VBA Excel
Below is the excel table i want to manipulate via SQL query in VBA.
Please find my VBA code.
Sub SQL()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
strFile = ThisWorkbook.FullName
strCon = ...
6
votes
2
answers
28k
views
Return recordset from function in classic ASP
I'm at a loss on how I can return a readable recordset from a function in classic ASP.
This is what I came up with, but it's not working:
Response.Clear
Response.CharSet = "utf-8"
Response....
6
votes
2
answers
15k
views
ADODB RecordSet as Access Report RecordSource
I have a simple form, a query and a report in Access 2003. I have to manipulate the results from the query in a recordset using VBA and then pass it on to the report as its RecordSource.
If I ...
6
votes
2
answers
2k
views
Recordset only returning 1000 records
I'm doing an ADODB recordset.open() command with an LDAP query to get all the users from my Active Directory.
There are about 2600 users, but I'm only getting back 1000 of them.
I've tried altering ...
6
votes
5
answers
9k
views
"Unspecified error" while opening an ADODB connection
I am facing "Unspecified error" in only one PC of my users.
Run-time error '-2147467259 (80004005)':
Unspecified error
I am running the below VBA code to open a connection to Access database ...
6
votes
3
answers
438
views
How to diagnose syntax error from a parameterized SQL Server query
I'm using VBA adodb to write INSERT statements in a SQL Server based on Excel row contents.
I'm using parameterized queries, so my VBA code has the following form:
sqlStatement = "INSERT INTO dbo....
6
votes
1
answer
1k
views
Upload file with ADODB for Web-DAV "cannot find any objects or data in accordance with the name..."
I have an MS Access 2007 VBA application running on Windows 7. One crucial function is to upload files to a WebDAV server. The code below works perfectly on one PC, but fails on other PCs (and yes, ...
5
votes
5
answers
17k
views
SQL query doesn't return full results for only one field
I'm having a problem using VBA to execute a SQL query and copy the results into an Excel worksheet.
When the sub excecutes, it only copies rows that are multiples of 256 (so rows 256, 512, 768 etc ...