|
-
Jan 17th, 2001, 10:28 AM
#1
Thread Starter
Lively Member
I need a sample code for displaying data(using ADO) through a data list control?
-
Jan 17th, 2001, 10:56 AM
#2
Addicted Member
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.
-
Jan 17th, 2001, 10:58 AM
#3
Thread Starter
Lively Member
I dont want it to be bound ...I wnat it to be unbound data..straight code.
-
Jan 17th, 2001, 11:03 AM
#4
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|