i use, to store in array all records from query:
Dim strDBRows() As Variant
Erase strDBRows()
strDBRows = RS.GetRows()
RS.Close
Set RS = Nothing
...
is possible to store into the array only all values from a single field, for example field F1
????
getrow on single record
-
- Administrator
- Posts: 78626
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: getrow on single record
You should make the recordset return only the single field F1:
Dim strSQL As String
strSQL = "SELECT F1 FROM MyTable"
RS.Open Source:=strSQL, ActiveConnection:=...
Dim strSQL As String
strSQL = "SELECT F1 FROM MyTable"
RS.Open Source:=strSQL, ActiveConnection:=...
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4370
- Joined: 26 Apr 2010, 17:36
Re: getrow on single record
no...HansV wrote:You should make the recordset return only the single field F1:
Dim strSQL As String
strSQL = "SELECT F1 FROM MyTable"
RS.Open Source:=strSQL, ActiveConnection:=...
my sql contain various fileds (i use from other loop.)
but in this case i need to store fron the varius values extracted from query and store it into array only the value of F1.
example of actual sql:
sql="select f1, f2,...f7 from ...."
-
- Administrator
- Posts: 78626
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- PlatinumLounger
- Posts: 4370
- Joined: 26 Apr 2010, 17:36
Re: getrow on single record
HansV wrote:You can use
strDBRows = RS.GetRows(Fields:="F1")
ops!
In need to store in array, two Fields F1 and F2
-
- Administrator
- Posts: 78626
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands