I have a database with a table named "Rooms", in this table there are 4 fields but we need to work
with 2 now, here's what i want to do:
i want to extract from the table two fields: RoomID and BuildID
these 2 fields represent the id of the room and in which building it stands, how can i do that ?
by the way:
i'm using this method to extract only one field, i can extract me, at least i don't know how, and
and it should be clear that the records are not sorted and not in order..
Dim ar As ADODB.Recordset
Dim i As Integer
Set ar = New ADODB.Recordset
Dim strSQL As String
openDB
strSQL = "SELECT BuildID FROM Rooms"
ar.Open strSQL, adc, adOpenForwardOnly, adLockReadOnly
If ar.EOF = False And ar.BOF = False Then
do while not ar.eof
i = ar.fields(0).value
ar.nextmove
Loop
End If
closeDB
With this method i can only get the Building ID but i also need the RoomID, here's the full
perspective, i have a TreeView and the root is Building, and inside each building there are rooms
i need to fill this list like this:
Building 1
Room 1
Room 5
Building 2
Room 2
Room 6
This is what i need... HELP !!!
Enter your message below
Sign in or Join us (it's free).