Results 1 to 4 of 4

Thread: Simple Question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Location
    Charlotte
    Posts
    127

    Question

    I need a sample code for displaying data(using ADO) through a data list control?


  2. #2
    Addicted Member jestes's Avatar
    Join Date
    Jan 2001
    Location
    Dallas
    Posts
    248

    no code!

    use the ADO control and set a connection string and a record source. then set your datalist properties (Record source, record field, data source, data field) to display the database info.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Location
    Charlotte
    Posts
    127
    I dont want it to be bound ...I wnat it to be unbound data..straight code.

  4. #4
    Addicted Member Babbalouie's Avatar
    Join Date
    Jan 2001
    Location
    On the bright, blue sea...
    Posts
    197

    Talking

    If youi dont want it to be bound, why use the DataList? Use a regular List Box....


    Dim gConn As ADODB.Connection
    Dim gRs As ADODB.Recordset

    Set gConn = New ADODB.Connection
    gConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=c:\books.mdb;"
    gConn.Open

    Set gRs = New ADODB.Recordset
    gRs.ActiveConnection = gConn
    gRs.CursorType = adOpenDynamic
    gRs.Source = "Select title from booksavailable order by title"
    gRs.Open

    Do While Not gRs.EOF
    List1.AddItem gRs!Title
    gRs.MoveNext
    Loop
    Building A Better Body Albeit Left Out Under Intense Extrapolation

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