ado

VBA Transactions

僤鯓⒐⒋嵵緔 提交于 2019-12-24 02:32:48
问题 I'm trying to insert some data into SQL from Excel VBA. The SQL commands are built up over the course of the VBA script, and include the use of some SQL variables. I'm trying to understand how transactions work in VBA, and whether they will work with what I need to do, I have the code below that will test this, but it does not work. It always gives me an error about "Must define scalar variable @name" so I assume there is an issue here with the scope of the data/transaction. How can I get

“Out of memory” error when processing large recordsets

ぃ、小莉子 提交于 2019-12-24 01:45:06
问题 I have a Windows Script host script which executes a Stored Procedure in our database and returns back a large recordset with about 225 columns (the column count does vary depending on the query, it may well get larger in the future). var adUseServer = 2; var adUseClient = 3; var adOpenForwardOnly = 0; var adLockReadOnly = 1; var dbc = new ActiveXObject("ADODB.connection") dbc.connectionString = "Driver={SQL Server};Server=MYDBSERVER;Database=MYDB;uid=USER;Pwd=PASSWORD;" dbc.CursorLocation =

deploy application with OraOLEDB provider

一个人想着一个人 提交于 2019-12-24 01:08:02
问题 I developed an application that uses Delphi 7, ADO and ORACLE, the provider I use is OraOLEDB (I need use this provider because the BLOB fields support). now I want to distribute this application with the provider. I search the web to download the Oracle provider, but has a size of 174 mb . I need to install this file on all client machines ? there is a smaller distribution of this file? UPDATE i am looking for a lightweigth (small) distribution of the OraOLEDB. Thanks in advance. 回答1: I

ado in excel, inserting records into access database

偶尔善良 提交于 2019-12-24 00:52:28
问题 First time asker, usually I can find the answer by searching, but my google-fu seems weak today. I have an excel workbook connecting to an access 2003 database to insert usage records The code i'm using is: sdbpath = ThisWorkbook.Path & "\Data.mdb" sCommand = "INSERT INTO Usage VALUES('" & Environ("Username") & "',#" & Now() & "#)" Dim dbCon As New ADODB.Connection Dim dbCommand As New ADODB.Command dbCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sdbpath & "; Jet OLEDB:Database

Delphi - Either BOF or EOF is True, or the current record has been deleted

半腔热情 提交于 2019-12-24 00:33:02
问题 This error showed when I tried to select on an empty table in MS SQL Server 2005: "either BOF or EOF is True, or the current record has been deleted". I have used TADOConnection and TADODataSet in Delphi 5 to connect and retrieve data from the database. Conn := TADOConnection.Create(nil); DataSet := TADODataSet.Create(nil); Conn.ConnectionString := 'Provider=SQLOLEDB.1;Password=sa;' + 'Persist Security Info=True;' + 'User ID=user;Initial Catalog=mydb;' + 'Data Source=MYPC\SQLEXPRESS;' + 'Use

DBGrid with read ahead capability using ADO

故事扮演 提交于 2019-12-23 20:53:19
问题 I'm working with ADO connecting to SQL Server 2005. My TADODataSet selects 1 million records. using a TDBGrid and setting the TADODataSet.CursorLocation to clUseServer works. but the TDBGrid chokes! How can I select 1 million records, avoid paging, and still be able to display records in the grid without fetching ALL records to the client side, letting the Grid read ahead as I scroll up and down? SQL enterprise manager can execute a query and select 1 million records asynchronously without

Server-side forward-only cursor breaks @@IDENTITY

醉酒当歌 提交于 2019-12-23 18:13:32
问题 Here is a minimal repro example. Database: CREATE TABLE temp (x int IDENTITY(1, 1), y int); Code (using VBA and ADO): Public Sub repro() Dim cn As New Connection Dim rs1 As New Recordset Dim cmd As New Command Dim rs2 As New Recordset cn.Open "Provider=SQLNCLI11;Server=myServer;Database=myDatabase;Trusted_Connection=Yes" rs1.Open "SELECT 1", cn, adOpenForwardOnly ' [X] ' cmd.ActiveConnection = cn cmd.CommandText = "INSERT INTO temp (y) VALUES (1) " cmd.Execute rs2.Open "SELECT @@IDENTITY", cn

Specify Source IP for ADO connection from Delphi to MySQL

陌路散爱 提交于 2019-12-23 15:53:28
问题 My Delphi application is connecting to a MySQL database using tAdoConnection. My customer has a machine that has two connections to the database server through the network. One is wired, the other wireless. So the machine running the application has two IP addresses on the same network. My problem is that the wireless connection on this machine is not stable. So I want to force the database connection to be made through the wired connection. I know the source IP address that I want to use.

“LIKE” operator works in MS Access, but not ADO

半城伤御伤魂 提交于 2019-12-23 09:34:22
问题 I'm trying to filter records using "Like" with asterisks, it works when using Access 2010 returning many records. I'm stumped why it returns nothing when used with ADO. The code includes multiple tables and columns so to troubleshoot I made a simple query. Here's the code: strsql = "SELECT tproducts.Prod_Name FROM tproducts " _ & " WHERE tproducts.Prod_Name Like " & Chr(34) & "SO*" & Chr(34) Set cn = New ADODB.Connection cn = connString cn.Open Set rs = New ADODB.Recordset rs.Open strsql, cn,

DELPHI ERROR : Multiple-step operation generater error. Check each status value

ぃ、小莉子 提交于 2019-12-23 04:49:20
问题 I have a procedure when click a bitbutton, it open a dialog box to load some files, and add it into AdoQuery (AQSource1). When I add some files, this error appear : "Multiple-step operation generater error. Check each status value." Only when I add multiple files selected. But if I selected a file by a file there is no error at all... But sometimes if I select multiple files this error did not show up either.... Kind a confusing for me... How to fix this ? in simple way... PS: I use Windows 7