ado

Check if I can execute some sql-command

I'm using ADO .NET and MS SQL Server 2008. I have a connection object to a server and a command: SqlConnection conn = /* my connection*/; string cmd = "some_sql_command"; I want to check if SQL Server can execute cmd. I don't want to execute cmd, but I want to know If SQL Server can execute it. cmd can be any single SQL statement, i...

Classic ASP, Provider: Type mismatch Error

I have the following ASP code below which is used within a import from a .csv file. I am getting the error on line rs_add_pg_asset_attr("level_3_integer_attribute_description") = rs_get_costs("sp_import_pg_attribute_value") I'm guessing the code is trying to set 2 columns in two different recordsets to be equal to the same thing? Cor...

AdoQuery Error using parameters

I need update a field value , increasing the old value. something like ths UPDATE MYTABLE SET FIELD1=FIELD1+VALUE WHERE .... but when run the next code i have this error Parameter object is improperly defined. Inconsistent or incomplete information was provided this is my code AdoQuery:=TADOQuery.Create(nil); try ...

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.Recordset RecordCount property always returns -1 even though I can access the Fields and see the data. Changing the CursorLocation = adUseClient ...

Database connectivity Delphi

I'm using delphi for years, but never for database stuff, but recently started researching and testing. I must say, i'm impressed, most of things happens automatically, i'm used to write by hand in php and python. i'm going to develop a commercial system for a friend, (2 layers) 5 user computers, 1 database server. Database server wi...

Is ODBC from MARS but ADO/OLEDB from VENUS?

Short question: I am finding I need to use MARS over ODBC but not over ADO/OLEDB, is that correct? Longer explanation: I just discovered my ODBC code (using "Driver={SQL Native Client}", MFC CDatabase code) needs to have MARS ("MARS_Connection=yes;") because, although I do not issue multiple SELECTs when opening a RecordSet, I do fetch...

How to prevent TADORecordset from scrolling?

I would like to prevent scrolling of ADORecordset basing on some condition. For example it would be convenient to do something like that: procedure TfrmMain.qryCenyBeforeScroll(DataSet: TDataSet); begin if not (condition) then qryCeny.DoNotScroll; //Just the idea end; How to do this? ...

How can I detect that a TadoConnection lost the communication with the server?

I need to detect when a TAdoConnection component has lost the connection with the server. I've tried using the OnDisconnect event but this only fires when the Close method is called or the Connected property is set to false. Another option I've tried is using a TTimer and executing a query like this SELECT 1 RESULT FROM DUAL in the O...

visual basic 6 > ADODB.Recordset > how to properly add new records to empty recordset manually?

How to add new records to a new & empty ADODB.Recordset manually? Right now, here's what I'm doing that isn't working: Dim rs as ADODB.Recordset rs.Open Dim Fields() as String Fields(0) = "SomeFieldName" Dim Values() as String Value(0) = "SomeValue" rs.AddNew Fields, Values ...

Generating an ADODB recordset programatically

I am attempting to generate an ADO RecordSet programatically within .Net. This will be passed on to existing legacy code in VB6 which is already expecting a ADO RecordSet, I do not wish to change the existing code. I was successful in defining fields within a new RecordSet ADODB.Recordset rs = new Recordset(); rs.Fields.App...

Can I return a byte array from a SQL Server VarBinary column using a parameterized query?

I wrote a small VBA procedure to test uploading and downloading of files as binary data into and out of a VarBinary column in SQL Server using ADO. The upload process appears to work, but I cannot get the download process to work. I believe the output parameter for VarBinary is setup incorrectly, but I cannot find any documentation on h...

Provider selection, when trying to access Excel table in Delphi 7

I am trying to connect to excel table from Delphi 7 using TAdoConnection component. The problem is when I select Microsoft.Jet.OLEDB.4.0, Extended Properties="Excel 8.0;", I sometimes receive error, that external table is not in the expected format. When i select: Provider=Microsoft.ACE.OLEDB.12.0;Extended Properties=Excel 12.0;...

How to determine row count in SSIS dataset

I frequently encounter a situation in SSIS packages where I run a SQL Command to return a set of rows from an ADO connection. There are cases where I want to branch based on the number of rows returned. The ado resultset is stored in an SSIS 'object' datatype. Is there a way in SSIS expression or Script component to get that count of row...

Delphi ADO Query

Hi. 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 pre-defined set of branch numbers. Thanks, Pieter. ...

Which provider should I select to connect to Excel version 11 through AdoConnection?

I need to connect to Excel table through TADOConnection, and I don't know what to write into ConnectionsString property. For Excel Version 8 I use Jet, for 12 I use ACE, what about 11? And how should connectionstring look? ...

Reading DataSet structure without reading it's data.

Scenerio: I want to add a calculated field to given (any) dataset during runtime. I don't know any other way to obtain a dataset structure other than performing DataSet.Open method. But the Open method causes that atleast one row of a data needs to be transfered from server to client. Then I need to close the DataSet, add field and reo...

How to connect to an OpenLDAP server using ADO (or else) and Delphi

Hello, I'm trying to connect to an OpenLDAP server 'clone'. I've tried using Synapse Library but I was able to get only a part (about 50%) of our public contacts. I'm trying now the ADO way (I've read that ADSI was compatible with other LDAP servers) but I can't get it working. ADOConnection provider connection string looks like this ...

Insert data into database [Delphi]

I'm trying using a TAdoTable component, On form Create I call .Append() and in a button i call .Post() but it loads the entire table! I don't need it to load anything, just need to insert a row into this table. I was wondering if there is "good way" of inserting data into database with Ado, i already tried using the a "manual" appro...

Can I get the current user from Active Directory LDAP using a VBA ADO Connection?

Is there any way to retrieve the user ID of the currently logged in user from Active Directory services using LDAP over an ADODB connection in VBA? I have only seen examples of how to query additional information about a user by specifying the user name and password. In those examples the user name is generally retrieved using Environ("...

Adding byte to the recordset works, adding same to a stream does not

A file is submitted, that file is put into a blob in a database (.AppendChunk), and that file should also emailed. What I want to do is: File is parsed from the form data into a variable (done). Variable is inserted into database (rs(key).AppendChunk var) (done). That variable is attached to an email (failing). However, if I read back w...