recordset

Problems with Recordset Filter

做~自己de王妃 提交于 2019-12-30 16:21:11
问题 I'm having trouble with a filter on an ADO Recordset in legacy ASP Classic code, and I'm trying to understand if what I'm trying to do is not supported, or if I'm just doing it wrong. I have a recordset of Items, and they have a Status of 1 (active) or 0 (inactive), and an optional End_Date. In my administrative user interface, I have a control to show all items or only those that should be displayed to end-users: Status = 1 AND ( End_Date is null OR End_Date > Date() ) To implement that

Problems with Recordset Filter

≡放荡痞女 提交于 2019-12-30 16:21:10
问题 I'm having trouble with a filter on an ADO Recordset in legacy ASP Classic code, and I'm trying to understand if what I'm trying to do is not supported, or if I'm just doing it wrong. I have a recordset of Items, and they have a Status of 1 (active) or 0 (inactive), and an optional End_Date. In my administrative user interface, I have a control to show all items or only those that should be displayed to end-users: Status = 1 AND ( End_Date is null OR End_Date > Date() ) To implement that

Retrieve ADO Recordset Field names (Classic ASP)

早过忘川 提交于 2019-12-30 06:11:11
问题 I wonder if someone can help: Long story short, I'm using MSSQL2005 to build a Pivot table. The data being examined is limited by date range (All data for 1 week starting from the nearest Monday to the date selected) When I run the Stored Proc and pass it a date, I get The correct table back eg: Time | 1 Jan 09 | 2 Jan 09 | 3 Jan 09 | ... 09:00 | 0 | 9 | 25 | ... 09:30 | 8 | 27 | 65 | ... 10:00 | 20 | 44 | 112 | ... (Apologies for the atrocious "table" formatting). The only problem I have is

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

What Strongly-Typed Data-Structure can I use to hold a collection of multiple RecordSets with different shape

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 11:36:48
问题 At the request of a responder to my original question here, I have been asked to reword the question in an effort to get to the bottom of the actual requirement. What Strongly-Typed Data-Structure can I use to hold a collection of multiple RecordSets where each RecordSet will contain rows that may be of a different shape to the other RecordSets ? This need is driven by the need to handle the data coming back from a Stored Procedure via a DbDataReader . The Stored Procedure may have multiple

ADODB.Recordset error '800a0e78' Operation is not allowed when the object is closed

两盒软妹~` 提交于 2019-12-24 10:57:15
问题 Set RsItem = Conn.Execute("EXEC E_UpdateDevBehaviourSmalls @ClientID=" & Session("ClientID") & " ,@UserID=" & Session("EUserID")& " ,@cCompID=" & cCompetenceid & " ,@reason=" &reason & " ,@comptype=" & comptype &",@GID=" & GID & " ,@Behaviour='" & MakeSendable(Behaviour) & "' ,@Deadline='" & deadlinedatetime & "' ,@DevBehaviour='" & MakeSendable(DevBehaviour) & "' ,@Why='" & MakeSendable(Why) & "' ,@ExtraNote='" & MakeSendable(ExtraNote) & "'") if GID = 0 then if not RsItem.eof then GID =

Returning the index of a field in a recordset

可紊 提交于 2019-12-24 06:22:55
问题 I have a recordset object generated by the following code. Private Sub GetID_Click() 'first find max id on sheet; used for if no ID is found on sheet Dim myRange As Range Dim maxIdOnSheet As Long Dim clientSheet As Worksheet Set clientSheet = Sheets("Client Codes") Set myRange = clientSheet.Range("A1:A1048576") maxIdOnSheet = WorksheetFunction.max(myRange) + 1 'set up connections with Nina's housing database Dim cmd As New ADODB.Command Dim conn As New ADODB.Connection Dim rs As New ADODB

Returning the index of a field in a recordset

不羁的心 提交于 2019-12-24 06:22:10
问题 I have a recordset object generated by the following code. Private Sub GetID_Click() 'first find max id on sheet; used for if no ID is found on sheet Dim myRange As Range Dim maxIdOnSheet As Long Dim clientSheet As Worksheet Set clientSheet = Sheets("Client Codes") Set myRange = clientSheet.Range("A1:A1048576") maxIdOnSheet = WorksheetFunction.max(myRange) + 1 'set up connections with Nina's housing database Dim cmd As New ADODB.Command Dim conn As New ADODB.Connection Dim rs As New ADODB

'Type Mismatch' Error on ADODB.Recordset

♀尐吖头ヾ 提交于 2019-12-24 05:53:38
问题 I have a program that is supposed to read data from an SQL database and report back to Excel. It works as expected on a 32-bit machine, but since I moved over to a 64-bit work environment, the program has failed to run. Here is a sample of my code (the first error returned): Private Sub SearchBox_Change() ResultBox.Clear Call CompileQuery 'If the query is empty If SearchBox.Value = "" Then NumShowingLabel = "Showing 0 of 0 Results" ResultBox.Clear GoTo noSearch End If 'Open a new query with

Access VBA recordset string comparison not working with wildcard

夙愿已清 提交于 2019-12-24 03:44:35
问题 I have loads of experience using VBA in Excel but very little experience using VBA in Access 2010. I'm trying to delete records from a recordset where one of the fields ends in "_X". When I use a wildcard the comparison fails. When I use a specific string, the comparison works as expected. Here is the Code that I am using. Dim db As Database: Set db = CurrentDb Dim tbl As Recordset: Set tbl = db.OpenRecordset("WRITEON") With tbl Do Until .EOF If ![ACOD] = "*_X" Then '"$ICP_X" works Debug