/ Forside / Teknologi / Udvikling / VB/Basic / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
VB/Basic
#NavnPoint
berpox 2425
pete 1435
CADmageren 1251
gibson 1230
Phylock 887
gandalf 836
AntonV 790
strarup 750
Benjamin... 700
10  tom.kise 610
VB and Access
Fra : asd987


Dato : 07-10-04 14:25

Hi,

I'm rather new in reading databases using VB. A question about reading an
Access-databse.

How can I display a field of a database in a listbox from record FIRST till
record LAST. I think I haven to use a loop but I don't know how.


Private Sub Command1_Click()
Data1.RecordSet.Move First

' ## start loop
' display Filed "PageNumber"

List1.AddItem "PageNumber"
' ## end loop
End Sub


Thanks,

Sjoerd



 
 
Jens Vestergaard (07-10-2004)
Kommentar
Fra : Jens Vestergaard


Dato : 07-10-04 14:50

I news:ck3g3k$nqe$1@news6.zwoll1.ov.home.nl,
skrev asd987 <asd987@home.nl>:
> Hi,
>
> I'm rather new in reading databases using VB. A question about
> reading an Access-databse.
>
> How can I display a field of a database in a listbox from record
> FIRST till record LAST. I think I haven to use a loop but I don't
> know how.
>
>
Private Sub Command1_Click()
myRecordSet.MoveFirst
Do While Not myRecordSet.EOF
List1.AddItem myRecordSet("PageNumber")
myRecordSet.MoveNext
Loop
End Sub

Remember some error handeling in case your recordset is empty or your field
is Null


--
mvh
Jens Vestergaard (mailadr i dette indlæg er ikke gyldig!)
www.railsoft.dk
Døgnets jernbanenyheder: www.railsoft.dk/medier.asp



Søg
Reklame
Statistik
Spørgsmål : 177558
Tips : 31968
Nyheder : 719565
Indlæg : 6408914
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste