|
-
Nov 23rd, 2000, 10:30 AM
#1
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
-
Nov 23rd, 2000, 12:00 PM
#2
Fanatic Member
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.
-
Nov 24th, 2000, 06:12 PM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|