| | |
|
|
|
Can SELECT be used on recordset? |
| message from =?Utf-8?B?S2Vu?= on 29 May 2004 |
Hi, I am looking for help. Can the SELECT statement be used on ADO recordset?
For example : SELECT * from <table>; Can <table> be ADO.record instead of a table name?
|
| =?Utf-8?B?S2Vu?= replied to Douglas J. Steele on 29 May 2004 |
Select * from rst1 union <ALL> ....
But at run-time, I got message saying rst1 is disconnected or misspelled or recordset is not exist.
I put a debug.print rst1.getstring before the Select statement, I got all expected rescords printed. Quite confuse about the message. Any idea?
|
| Douglas J. Steele replied to =?Utf-8?B?S2Vu?= on 30 May 2004 |
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Ken" <anonymous@discussions.microsoft.com> wrote in message
news:458A8714-9E92-4D12-ACAB-8748C80E3E76@microsoft.com...
use ADO to build a query to extract all information and union with <ALL> for
the warehousecode combo box. So as a result in the combo box list, I will
have <ALL> as the first choice followed by all warehouse codes. I got all
these done perfectly. However, if there is no warehouse code associated
with this product, in the list I still see <ALL> as one and only one choice.
So what I am going to do is, after I got the recordset, I test if it is EOF.
If yes, I will not union with <ALL>. Since combo boc ROW Source accepts
only query, so my query is this:
or recordset is not exist.
expected rescords printed. Quite confuse about the message. Any idea?
|
| =?Utf-8?B?S2Vu?= replied to Douglas J. Steele on 30 May 2004 |
Yes, this is what I am doing. But if the result of the SQL is empty, I still will have <ALL> that is no meaning at all.
Thanks anyway for your suggestion.
|
| Douglas J. Steele replied to =?Utf-8?B?S2Vu?= on 30 May 2004 |
So check whether there's only 1 row in your recordset, and reset the combo
box's rowsource if there is.
|
|
Archived message: Can SELECT be used on recordset? (MS Access Forms)