ado

What is this 'Multiple-step OLE DB' error?

I'm doing a little bit of work on a horrid piece of software built by Bangalores best. It's written in mostly classic ASP/VbScript, but "ported" to ASP.NET, though most of the code is classic ASP style in the ASPX pages :( I'm getting this message when it tries to connect to my local database: Multiple-step OLE DB operation generated ...

parametrization in VBScript/ASP Classic and ADO

I'm a bit confused here. Microsoft as far as I can tell claims that parametrization is the best way to protect your database from SQL injection attacks. But I find two conflicting sources of information here: This page says to use the ADO command object. But this page says that the command object isn't safe for scripting. I seem to ...

Update schema and rows in one transaction, SQL Server 2005

I'm currently updating a legacy system which allows users to dictate part of the schema of one of its tables. Users can create and remove columns from the table through this interface. This legacy system is using ADO 2.8, and is using SQL Server 2005 as its database (you don't even WANT to know what database it was using before the att...

Executing stored procedures with date parameters: Command Object vs Connection Object

When supplying dates to a stored procedure via a parameter I'm a little confused over which format to use for the dates. My original VBA syntax used the ADO Connection object to execute the stored procedure: Set SentDetailRS = Me.ADOConnectionToIntegrity.Execute("dbo.s_SelectAggregatedSentDetailList '" & fCSQLDate(EffectiveDate) & "'", ...

Deleting rows in joined tables using ADO

Now I have seen this question in another forum but it didn't had an acceptable answer. Suppose I have two tables, the Groups table and the Elements table. The tables have no defined relationships. The Elements table has an IdGroup field that refers to the IdGroup (PK) field of the Groups table. I use the following query through an ADO ...

Using SQLITE with VB6

I am currently using an MSAccess mdb file for a redistributable app. A while ago I found out about SQLite, as an alternative to my solution, but the binaries they provide do not offer the possiblilty of using them as an object in VB6. (Or at least I couldn't figure it out how). Does anyone has a link, or could write a little about con...

How to check if an OLEDB driver is installed on the system?

Hi! How can I make sure that a certain OLEDB driver is installed when I start my application? I use ADO from Delphi and would like to display a descriptive error message if the driver is missing. The error that's returned from ADO isn't always that user-friendly. There are probably a nice little function that returns all installed drive...

Sorting ADO recordset text field as numeric

Using VBA i have a set of functions that return an ADODB.Recordset where all the columns as adVarChar. Unfortunately this means numerics get sorted as text. So 1,7,16,22 becomes 1,16,22,7 Is there any methods that can sort numerics as text columns without resorting to changing the type of the column? Sub TestSortVarChar() Dim strBef...

IIS Connection Pool interrogation/leak tracking

Per this helpful article I have confirmed I have a connection pool leak in some application on my IIS 6 server running W2k3. The tough part is that I'm serving 300 websites written by 700 developers from this server in 6 application pools, 50% of which are .NET 1.1 which doesn't even show connections in the CLR Data performance counter...

How can I open an Access DB via ADO so that I can write, but others can only read?

From the documentation, I would expect adModeShareDenyWrite to be the way, but it's not working right. I'm using an Access database via ADO. My connection string says Mode=8, which is adModeShareDenyWrite. But when I try to delete a row from a table, I get: Unspecified error, Description:Could not delete from specified tables., Sou...

Adding field to open recordset

I there a simple way to append a new field to an existing open ADO RecordSet? fields.append() won't work if the RecordSet is open, and closing appears to kill the existing data. NB: I'm using Microsoft ActiveX DataObject 2.8 Library ...

How can I connect to an Oracle database as SYS using an ADO connection string?

I am trying this: Provider=MSDASQL.1;Persist Security Info=False;User ID=sys;Password=pwd;Initial Catalog=DATABASE;Data Source=OdbcDataSource;DBA Privilege=SYSDBA But I get the error: [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed I'm using Delphi, but answers in any language are welcome. Clarification: I am ab...

Perl ADO thinks printed output in stored procedure is an error!

First of all (in case this is important) I'm using ActiveState's Perl (v5.8.7 built for MSWin32-x86-multi-thread). I've just emerged from a three hour long debugging session, trying to find the source of an error. I found there was simply no error, but for some reason ADO's connection object was getting the Errors.Count increased with e...

Classic ASP: Page text translated from SQL table, a faster way?

Using classic ASP VBScript, coupled to MS SQL Server, we have a function that takes 3 integers, page_id, heading_id, language_id it looks up the page heading in a translation table... This table contains roughly 10,000 rows... The heading column is nvarchar(1000) plus the 3 int columns meaning it's around 2KiB per row max... so my qu...

Access 2007 VBA Query Shows Data in Query Analyzer But Not in VBA Coded Recordset

I have a function I've written that was initially supposed to take a string field and populate an excel spreadsheet with the values. Those values continually came up null. I started tracking it back to the recordset and found that despite the query being valid and running properly through the Access query analyzer the recordset was emp...

View output of 'print' statements using ADOConnection in Delphi

Some of my MS SQL stored procedures produce messages using the 'print' command. In my Delphi 2007 application, which connects to MS SQL using TADOConnection, how can I view the output of those 'print' commands? Key requirements: 1) I can't run the query more than once; it might be updating things. 2) I need to see the 'print' results e...

Entity Framework: Working with FK's (why do they get hidden?)

First of all, let's define a few tables: Users table will store information about a user: Users - UserID (int, PK) - ... UserTasks is a table that stores a task associated with a user: UserTasks - userID (int, FK to Users table) - taskName (varchar) When I generate the UserTasks table using the ADO Entity Framework, I'll get a c...

Reading Excel in .NET, how to get row number?

Hi, I have got this code to read an Excel file using C# .NET (from http://davidhayden.com/blog/dave/archive/2006/05/26/2973.aspx) string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Book1.xls;Extended Properties=""Excel 8.0;HDR=YES;"""; DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb"...

How do I create an empty MDB from ADO

I need to create an empty .mdb file, so that I can then run ADO commands on it (not ADO.NET). Is there a way to create an empty mdb using ADO? ...

How to set a GUID as ADO query parameters from Delphi?

MS Access allows the numeric type GUID (in German it's called 'Replikations-ID', so I guess in English that would be 'replication id') which is stored as a 16 byte binary field in the database. I found how to access these fields in Delphi with TAdoQuery/TAdoTable using TGuidField(...).AsGuid, but now I want to execute an SQL-Query like ...