PC Review


Reply
Thread Tools Rate Thread

Access 2002: bind adodb recordset to listbox recordset property

 
 
Craig Buchanan
Guest
Posts: n/a
 
      29th Apr 2005
I would like to bind a disconnected ADODB (v2.7) recordset to a listbox's
recordset property. For some reason, the values aren't being displayed.

here's the form's coding:

....
'i create the recordset
Set m_TableDefinition = New ADODB.Recordset
With m_TableDefinition
.CursorLocation = adUseClient
.Fields.Append "Location", adVarChar, 50
.Fields.Append "Name", adVarChar, 255
.Fields.Append "Alias", adVarChar, 255
.Fields.Append "DLL", adVarChar, 50
.Fields.Append "DSN", adVarChar, 50
.Fields.Append "UserId", adVarChar, 50
.Open
End With

....
set rs = myobject.Recordset

'rs has rows
debug.print rs.recorcount

Me.lstTables.RowSourceType = "Table/Query"
Set Me.lstTables.Recordset = rs

what am i missing? i've tried rs.movefirst for the set me.lsttables line to
no effect.

thanks,

craig buchanan


 
Reply With Quote
 
 
 
 
Craig Buchanan
Guest
Posts: n/a
 
      29th Apr 2005
after further testing, i have discovered:

* when i enumerate the .recordset property, there are values
* when i enumerate the listbox's column property, there are only nulls.
the number of columns and rows, however are correct
* when i switch from ado 2.7 to 2.1 (this was the original reference),
the results above are the same.

does the .recordset property only work with a DAO recordset? what am i
missing here?



"Craig Buchanan" <msnews.microsoft.com> wrote in message
news:%(E-Mail Removed)...
> I would like to bind a disconnected ADODB (v2.7) recordset to a listbox's
> recordset property. For some reason, the values aren't being displayed.
>
> here's the form's coding:
>
> ...
> 'i create the recordset
> Set m_TableDefinition = New ADODB.Recordset
> With m_TableDefinition
> .CursorLocation = adUseClient
> .Fields.Append "Location", adVarChar, 50
> .Fields.Append "Name", adVarChar, 255
> .Fields.Append "Alias", adVarChar, 255
> .Fields.Append "DLL", adVarChar, 50
> .Fields.Append "DSN", adVarChar, 50
> .Fields.Append "UserId", adVarChar, 50
> .Open
> End With
>
> ...
> set rs = myobject.Recordset
>
> 'rs has rows
> debug.print rs.recorcount
>
> Me.lstTables.RowSourceType = "Table/Query"
> Set Me.lstTables.Recordset = rs
>
> what am i missing? i've tried rs.movefirst for the set me.lsttables line

to
> no effect.
>
> thanks,
>
> craig buchanan
>
>



 
Reply With Quote
 
Craig Buchanan
Guest
Posts: n/a
 
      1st May 2005
Looks like the issue had to do w/ the LockType property. These settings
work: adLockOptimistic,adLockPessimistic. These settings don't work:
adLockBatchOptimistic,adLockReadOnly. Apparently, the default setting is
adLockReadOnly.

The CursorType property does not seem to have an effect.

While CursorLocation property does not seem to have an effect, I have read
that adUseClient is recommend. The default is adUseServer

Craig Buchanan

"Craig Buchanan" <msnews.microsoft.com> wrote in message
news:(E-Mail Removed)...
> after further testing, i have discovered:
>
> * when i enumerate the .recordset property, there are values
> * when i enumerate the listbox's column property, there are only nulls.
> the number of columns and rows, however are correct
> * when i switch from ado 2.7 to 2.1 (this was the original reference),
> the results above are the same.
>
> does the .recordset property only work with a DAO recordset? what am i
> missing here?
>
>
>
> "Craig Buchanan" <msnews.microsoft.com> wrote in message
> news:%(E-Mail Removed)...
>> I would like to bind a disconnected ADODB (v2.7) recordset to a listbox's
>> recordset property. For some reason, the values aren't being displayed.
>>
>> here's the form's coding:
>>
>> ...
>> 'i create the recordset
>> Set m_TableDefinition = New ADODB.Recordset
>> With m_TableDefinition
>> .CursorLocation = adUseClient
>> .Fields.Append "Location", adVarChar, 50
>> .Fields.Append "Name", adVarChar, 255
>> .Fields.Append "Alias", adVarChar, 255
>> .Fields.Append "DLL", adVarChar, 50
>> .Fields.Append "DSN", adVarChar, 50
>> .Fields.Append "UserId", adVarChar, 50
>> .Open
>> End With
>>
>> ...
>> set rs = myobject.Recordset
>>
>> 'rs has rows
>> debug.print rs.recorcount
>>
>> Me.lstTables.RowSourceType = "Table/Query"
>> Set Me.lstTables.Recordset = rs
>>
>> what am i missing? i've tried rs.movefirst for the set me.lsttables line

> to
>> no effect.
>>
>> thanks,
>>
>> craig buchanan
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how use listbox recordset property with ado memory recordset ? scott w t Microsoft Access 0 8th Nov 2008 01:51 PM
Bind ADO Recordset (filtered) to a Listbox JimS Microsoft Access Form Coding 1 13th Jun 2008 10:48 AM
Get ADODB.Recordset data to appear in an Access form Listbox =?Utf-8?B?ZGF2aWQwMjg3MDc=?= Microsoft Access 1 30th Jan 2006 04:48 PM
How to load data in ListBox using one command from ADODB RecordSet =?Utf-8?B?QWxwZXNoIFBhdGVs?= Microsoft Access 3 24th Aug 2005 10:35 AM
How to load data in ListBox using one command from ADODB RecordSet =?Utf-8?B?QWxwZXNoIFBhdGVs?= Microsoft Access Getting Started 3 22nd Aug 2005 10:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:16 PM.