adodb

VBA to Prevent Keyboard Input While a Package Object (XML) is Read into ADODB Stream?

只愿长相守 提交于 2019-12-23 07:48:52
问题 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 do: xmlFile.OLEFormat.DoVerb 1 This opens the package object, and I have another subroutine that gets the open instance of Notepad.exe, and reads its contents in to ADODB stream. An example of this procedure is available on Google Docs: XML_Test.pptm. During this process there is a few seconds

Classic ASP Error: Operation is not allowed when the object is closed

隐身守侯 提交于 2019-12-23 06:08:13
问题 I have cruised and implemented code from some of the other responses to this question, but I'm still having no luck. I am still getting the error. If ((bReport And bIsDate And CheckPermissions("lotsales")) Or Request.QueryString("report")) Then OpenDB Dim oRs, sSQL, sSQL2, iCancellations, iSales, sDate, sInitDate, sEndDate, iPhaseID, iPhaseNumber, rowCount sInitDate = Request("startDate") sEndDate = Request("endDate") sSQL = "sp_get_lot_sales_test '" & sInitDate & "', '" & sEndDate & "', " &

Transpose rows column in GetRows

流过昼夜 提交于 2019-12-23 02:57:05
问题 Below VBA code does the job, but I'm losing some 3 sec in the transpose part. Is there a way I can get the same result or in the SQL query or in the getrows process without losing the 3 secs? Sub LoadData() Dim strCon, srtQry As String, tmpArray, tmpArray2, R As Variant, i, j As Long Set cn = CreateObject("ADODB.Connection") Set rs = CreateObject("ADODB.Recordset") strCon = "DRIVER={MySQL ODBC 5.2 ANSI Driver};" & _ "SERVER=localhost;" & _ "DATABASE=tbname;" & _ "USER=root;" & _ "PASSWORD

ADODB COM object not found

大城市里の小女人 提交于 2019-12-22 12:26:11
问题 I am using ADODB COM object in my c# application which is developed on Windows 2008 R2 Standard 64bit. Now I have moved application on prod server with Windows 2008 Standard 64bit(not R2) and now I get error below. It seems MDAC 2.8 is not installed on my prod machine? I can't find any reference how to install MDAC 2.8 on Windows 2008 machine, maybe someone could point me to right direction? Error: Unable to cast COM object of type 'ADODB.StreamClass' to interface type 'ADODB._Stream'. This

Class: ADORecordSet_mysql Easy way to get an Array indexed by id of row

依然范特西╮ 提交于 2019-12-22 11:33:48
问题 I have a table with a primary key called 'id' and I am using ADODB and getting a ADORecordSet_mysql back. I need an array where the id is associated with a row in the result set, but ADODBRecordSet_mysql only seems to have a GetArray(int startingRow) method that returns an array indexed by startingRow (where the default is 0). I don't want to have to iterate through this result set an associate the id's to each row myself and I don't like the idea of having to pass into GetArray a starting

Access form linked to disconnected ADODB.Recordset: save changes

吃可爱长大的小学妹 提交于 2019-12-22 10:02:36
问题 I am trying to set up a form to use a disconnected ADODB.Recordset as its source. The issue I have is that changes are not saved into the original Access table upon closing the form and replying "Yes" to the prompt. What am I missing ? Note: Please don't tell me the method is useless, it's just a POC with a local table, I plan to try later with a more "distant" recordset. Dim conn As ADODB.Connection Dim rs As ADODB.Recordset Private Sub Form_Load() Set conn = New ADODB.Connection conn.Open

CopyFromRecordset copies & pastes only first one row even though multiple records are present in Excel

我是研究僧i 提交于 2019-12-22 08:58:06
问题 I have an Excel sheet containing table like data strSQL = "SELECT S.FIELD_NAME1,S.FIELD_NAME2,S.FIELD_NAME3 from [SourceData$A1:IV6] S" Dim cn as ADODB.Connection Dim rs as ADODB.Recordset cn.Open strCon Set rs = CmdSqlData.Execute() Worksheets("SourceData").Cells.ClearContent Worksheets("AnswerData").Cells(2, 1).CopyFromRecordset rs Results : Only first row and other records are ignored. I have tried below query ., strSQL = "SELECT COUNT(*) from [SourceData$A1:IV6] S" Which gives 5 as result

Passing current ADO Record to another function

折月煮酒 提交于 2019-12-22 04:17:12
问题 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) While (Not data.EOF) ProcessRecord ([data.CurrentRecord]) ' <-- There is no CurrentRecord property. data.MoveNext Wend End Sub Private Sub ProcessRecord(singleRecord As ADODB.Record) ' Do stuff. End Sub The scant info I've found on the subject says to pass the entire RecordSet or to create a new Record

XML output parameters with ADODB in ASP Classic

假如想象 提交于 2019-12-21 06:57:39
问题 I found this error looking for a solution to a problem of retrieving XML at ASP classic: Declaring XML output parameters with ADODB in ASP Classic I have the same error working with Classic ASP and SQL Server 2003. I used to work with a .dll in VB6, where I could get the XML code. But now I need to do it from SQL direct to ASP. Did you manage to solve it? My code in classic ASP so far is: set objCommandoOP = Server.CreateObject("ADODB.Command") Set objCommandoOP.ActiveConnection = objConexion

Execute Query from Access via Excel Query in VBA

情到浓时终转凉″ 提交于 2019-12-21 06:43:53
问题 Access has saved a query that was designed with the query builder called 'myQuery'. The database is connected to the system via ODBC connection. Macros are all enabled. Excel Has makes a ADODB connection to connect to the database via Dim con As ADODB.Connection Dim rs As ADODB.Recordset Set con = New ADODB.Connection With con .Provider = "Microsoft.ACE.OLEDB.12.0" .Open "MyDatabase.accdb" End With Usually you would go ahead and just write your SQL, which is perfectly fine and then just do