Results 1 to 3 of 3

Thread: Please help me ! ! ! ! !

  1. #1
    Guest
    Why the following code don't work; the datalist is always empty. The recordset have 80 records.

    Option Explicit

    Dim myConnection As ADODB.Connection
    Dim myRecordset As ADODB.Recordset

    Private Sub Form_Load()

    Set myConnection = New ADODB.Connection
    Set myRecordset = New ADODB.Recordset

    myConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\S\Recetas\Cocina2000.mdb;"
    myConnection.Open

    myRecordset.Open "Categoria", myConnection, adOpenStatic, , adCmdTable

    DataList1.BoundColumn = myRecordset!cat_receta
    DataList1.ListField = myRecordset!cat_descri
    Set DataList1.RowSource = myRecordset

    End Sub



    TIA

  2. #2
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982

    Wink

    You have to specify a cursor location, the 4th parameter for the recordset.open method.

    it should be somehting like

    Code:
    myRecordset.Open "Categoria", myConnection, adOpenStatic, adUseClient, adCmdTable
    Also you may need to refresh the data after setting the row source property.

    Code:
    Set DataList1.RowSource = myRecordset 
    DataList1.refresh
    That should work.




    Things I do when I am bored: DotNetable

  3. #3
    Guest

    Smile i have the solution

    in another forum MAKAI give to me the solution

    DataList1.BoundColumn = "cat_receta"
    DataList1.ListField = "cat_descri"
    Set DataList1.RowSource = myRecordset

    now the datalist1 works fine.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width