Questions tagged [recordset]

A recordset is a subset of a database table consisting of columns and rows specified by a query language

1047 questions
20
votes
4 answers

Whats the difference between rs.close vs rs = nothing in a RecordSet

I often find it confusing as to when it is appropriate to use: rs.Close opposed to Set rs = Nothing I can understand needing to close a connection to a source, but should I be using both when the variable falls out of scope? Can I just set the…
Curtis Inderwiesche
  • 4,792
  • 18
  • 55
  • 81
15
votes
3 answers

Java Programming - Spring and JDBCTemplate - Use query, queryForList or queryForRowSet?

My Java (JDK6) project uses Spring and JDBCTemplate for all its database access. We recently upgraded from Spring 2.5 to Spring 3 (RC1). The project does not use an ORM like Hibernate nor EJB. If I need to read a bunch of records, and do some…
Adrian
  • 5,571
  • 9
  • 41
  • 68
14
votes
1 answer

Deep Copy or Clone an ADODB recordset in VBA

I have been searching for a way of duplicating or copying a recordset in VBA. And by that I mean, having the undelying data independent of each other. I have tried Set copyRS = origRS.Clone Set copyRS = origRS When I use any of the methods I cant…
Ernesto Monroy
  • 538
  • 7
  • 23
12
votes
4 answers

insert full ADO Recordset into existing ACCESS table WITHOUT LOOP

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…
Barrie van Boven
  • 179
  • 1
  • 1
  • 10
11
votes
1 answer

Multiple Row Update SQL Trigger from Single Update SQL Statement

Ok. I am quite new to SQL triggers and have had some issues with them. Insert trigger works just fine, and the Delete trigger also. At first, doing a delete on multiple rows would only delete one, but I managed to figure that one out for myself…
Irresistance
  • 137
  • 1
  • 1
  • 9
10
votes
3 answers

Quickly select random ID from mysql table with millions of non-sequential records

I've looked around and there doesnt seem to be any easy way to do this. It almost looks like it's easier just to grab a subset of records and do all the randomizing in code (perl). The methods I've seen online seem like theyre geared more to at most…
qodeninja
  • 10,062
  • 27
  • 92
  • 146
10
votes
4 answers

Easiest way to compare two files with lists of song titles

I have two lists of song titles, each in a plain text file, which are the filenames of licensed lyric files - I want to check if the shorter list titles (needle) are in the longer list (haystack). The script/app should return the list of titles in…
pbhj
  • 266
  • 2
  • 12
9
votes
2 answers

Closing PreparedStatements

Does use of PreparedStatements and ResultSets creates a "new database instance" everytime they are used? Or, whith other words, if I use a PreparedStatement and a ResultSet, should I close them after every use or once I finish? Example: while…
Sarah Oneills
  • 93
  • 1
  • 3
9
votes
1 answer

Creating Route53 Record Sets via Shell Script

As a part of my shell script, I am trying to create record sets in AWS Route53. However, using variables in the aws cli within my shell script to create those records set, my variables exported in the Shell scripted are not being passed to the aws…
9
votes
2 answers

Why can't I do a "with x as (...)" with ADODB and Oracle?

I fail to execute an SQL query with a with clause via ADODB and Oracle. That is, the following snippet works: Dim cn As ADODB.connection Set cn = .... Dim rs As ADODB.recordSet Set rs = New ADODB.Recordset rs.Open "select 'foo' x from dual",…
René Nyffenegger
  • 35,550
  • 26
  • 140
  • 232
9
votes
2 answers

Retrieve ADO Recordset Field names (Classic ASP)

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…
Basic
  • 25,223
  • 23
  • 108
  • 188
8
votes
6 answers

How to populate a ComboBox with a Recordset using VBA

There is some literature available at expert's exchange and at teck republic about using the combobox.recordset property to populate a combobox in an Access form. These controls are usually populated with a "SELECT *" string in the 'rowsource'…
Philippe Grondier
  • 10,395
  • 3
  • 29
  • 67
8
votes
5 answers

ADODB open recordset fails / "Operation is not allowed when object is closed"

I have the following UDF in excel which uses ADO to connect to my MSSQL server. There it should execute the scalar udf "D100601RVDATABearingAllow". For some reason the parameters that I try to append are not send to the sql server. At the server…
Lumpi
  • 2,403
  • 5
  • 34
  • 44
8
votes
1 answer

Recordset Closed After Stored Procedure Execution

I'm executing a stored procedure using ADO in VBA. I'm trying to populate the recordset with the results from a stored procedure in SQL Server 2008. Example of the VBA below: Public Function DoSomething() As Variant() Dim oDB As ADODB.Connection:…
Gareth
  • 4,762
  • 5
  • 36
  • 68
8
votes
1 answer

How should Iterator implementation deal with checked exceptions?

I'm wrapping a java.sql.RecordSet inside a java.util.Iterator. My question is, what should I do in case any recordset method throws an SQLException? The java.util.Iterator javadoc explains which exceptions to throw in various situations (i.e.…
amarillion
  • 21,899
  • 13
  • 64
  • 80
1
2 3
69 70