Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

Access 2002: bind adodb recordset to listbox recordset property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Craig Buchanan - 29 Apr 2005 17:23 GMT
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
Craig Buchanan - 29 Apr 2005 18:29 GMT
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?

> 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.
[quoted text clipped - 30 lines]
>
> craig buchanan
Craig Buchanan - 01 May 2005 00:14 GMT
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

> after further testing, i have discovered:
>
[quoted text clipped - 42 lines]
>>
>> craig buchanan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.