ado

insert full ADO Recordset into existing ACCESS table WITHOUT LOOP

可紊 提交于 2019-12-28 05:54:34
问题 I have a filled ADO recordset in my VBA module. I also have a table in ACCESS that has exactly the same structure as the recordset. Now I fill the table using a loop (which is fine) going through each dataset record. What I am wondering: is there a way to insert an entire recordset into the access table? (and more importantly: would this be significantly faster) 回答1: Here's a basic example (run from excel in this case) which illustrates using a disconnected recordset to add records. Sub

Parameter of stored procedure not found

别说谁变了你拦得住时间么 提交于 2019-12-25 13:12:08
问题 I use the following code to call my stored procedure using TADOStoredProc type MySP.Connection := aConnection; MySP.ProcedureName := 'dbo.UpdateErrors'; MySP.Parameters.ParamByName('@Error_Number').value := -1; MySP.Parameters.ParamByName('@NewError_Name').value := 'errorM1'; MySP.Parameters.Refresh; MySP.ExecProc; The parameter @Error_Number is part of the stored procedure UpdateErrors using SQL Server Management Studio, I add snip image for confirmation but I can't understand why I get an

ConnectionString issues - SQL Server 2008 on Windows 2008

不想你离开。 提交于 2019-12-25 03:46:10
问题 We have a third party program that used to run on Windows 2003 against SQL Server 2000 database (app and db are on same machine). We are trying to migrate/install it on Windows 2008/ SQL Server 2008. The connection string as specified does not seem to allow it to connect it to SQL Server (see below) <Configuration name="PROG"> <ADOConnection> Provider=SQLOLEDB.1;Persist Security Info=False;User Id=sa;Pwd=p@ssw0rd;Initial Catalog=DB_NEW;Data source=servername </ADOConnection> </Configuration>

High Order ASCII chars in MS SQL 6.5 INSERT using ADO

ⅰ亾dé卋堺 提交于 2019-12-25 03:12:52
问题 I've searched all about and can't find an answer to this. I have an SQL statement similar to insert myTable VALUES ( 'Value1', 'Value2', 'Value 3²More', 'Value 4√Even More' ) where the square char (between the 3 and the More) is 0xFD and the square root sign (between the 4 and the Even) is 0xFB. This is going from ADO into an MSSQL 6.5 database. I've tried escaping the chars such using \xFE, \0xFE, even using octal (\o375) but I have no idea how to do this. Basically, these chars are

files needed for deploying delphi 2010 with ms access 2007 and ado for database connection

女生的网名这么多〃 提交于 2019-12-25 02:44:58
问题 I'm building database application with delphi 2010 in which the database i used is ms access 2007 and ado as the connection.... then, i used installshield express from delphi 7 to do the deployment.... i open the setup file in my computer and there is no problem with it..but when i open the setup file in client computer, there is some error... what makes me confused is what files needed to be added in the setup file for the deployment? i've installed mdac 2.8 sp1 in the client, but it's still

Unable to query dynamically named range on Excel sheet using ADO

坚强是说给别人听的谎言 提交于 2019-12-25 02:43:49
问题 Suppose I have an Excel Sheet named Adjustments stored in a variable called wksName and, on that sheet, I have a named range defined as follows if you look in the Name Manager: tblData =OFFSET(Adjustments!$A$1,0,0,COUNTA(Adjustments!$A:$A),4) So that it expands to as many rows as we have data in columns A thru D. Now I have the following code in my VBA module: Set ExcelCon = CreateObject("ADODB.Connection") Set ExcelRecSet = CreateObject("ADODB.Recordset") ExcelCon.ConnectionString =

Insert many records using ADO

二次信任 提交于 2019-12-25 01:45:55
问题 I am looking the fastest way to insert many records at once (+1000) to an table using ADO . Options: using insert commands and parameters ADODataSet1.CommandText:='INSERT INTO .....'; ADODataSet1.Parameters.CreateParameter('myparam',ftString,pdInput,12,''); ADODataSet1.Open; using TAdoTable AdoTable1.Insert; AdoTable1.FieldByName('myfield').Value:=myvale; //.. //.. //.. AdoTable1.FieldByName('myfieldN').value:=myvalueN; AdoTable1.Post; I am using delphi 7, ADO, and ORACLE. 回答1: Using ADO I

Using ADODB to print recordset to an Excel sheet

断了今生、忘了曾经 提交于 2019-12-24 22:44:06
问题 I'm trying to use an ADODB connection to create a record set from a query, then copy the contents of that record set into a range of cells Below is the outline of my code, but I keep getting errors Run-time error '-2147467259 (80004005)' Unspecified error (I've replaced my specific references with all caps dummy references) Sub Subroutine() 'establish ADODB connection to retrieve data from TABLE Dim objConnection As New ADODB.connection Dim objRecordset As New ADODB.Recordset With

How to use a RecordSet.Find with TADOQuery?

早过忘川 提交于 2019-12-24 17:39:50
问题 In this question: Delphi ADO : Locate with dataset filter on bug an ADO bug was described where the Filter string is ignored during .Locates. This is causing problems for us migrating from the BDE because we have a lot of code that changes the filter according to user input. We had expected TADOQuery to provide a working migration path. We were wrong. We can of course change our current filters to WHERE statements, but that's a lot of work and risk concatenating the filter strings to filter

VBA ADO Excel 2010

爷,独闯天下 提交于 2019-12-24 17:15:28
问题 Hi I am working in a excel file with 46 pivot tables. The code below changes the connection of each pivot table to a new existing connection. Sub changeConnection() Dim pTable As Variant Dim sheet As Variant Dim workBookName As String workBookName = "filename.xlsm" For Each sheet In Workbooks(workBookName).Worksheets For Each pTable In sheet.PivotTables pTable.changeConnection Workbooks(workBookName ).Connections("connection name") Next pTable Next sheet End Sub I want everything to stay the