this is the code that i revised from what i've copied, i replaced the Table fields with the fields that are present in my MSAccess file,
Public Sub StudInfo() LV1.ListItems.Clear Set RS1 = New ADODB.Recordset SQL1 = "Select * from Student_Information" RS1.Open SQL1, Con, adOpenStatic, adLockOptimistic For N = 1 To RS1.RecordCount LV1.ListItems.Add , , RS1![StudentNumber] LV1.ListItems(LV1.ListItems.Count).ListSubItems.Add , , RS1!FamilyName LV1.ListItems(LV1.ListItems.Count).ListSubItems.Add , , RS1!FirstName LV1.ListItems(LV1.ListItems.Count).ListSubItems.Add , , RS1!MaternalName LV1.ListItems(LV1.ListItems.Count).ListSubItems.Add , , RS1!Birthdate LV1.ListItems(LV1.ListItems.Count).ListSubItems.Add , , RS1!Age LV1.ListItems(LV1.ListItems.Count).ListSubItems.Add , , RS1!FatherN LV1.ListItems(LV1.ListItems.Count).ListSubItems.Add , , RS1!MotherN LV1.ListItems(LV1.ListItems.Count).ListSubItems.Add , , RS1!FatherO LV1.ListItems(LV1.ListItems.Count).ListSubItems.Add , , RS1!MotherO LV1.ListItems(LV1.ListItems.Count).ListSubItems.Add , , RS1!Address LV1.ListItems(LV1.ListItems.Count).ListSubItems.Add , , RS1!Department LV1.ListItems(LV1.ListItems.Count).ListSubItems.Add , , RS1!Level LV1.ListItems(LV1.ListItems.Count).ListSubItems.Add , , RS1!SY LV1.ListItems(LV1.ListItems.Count).ListSubItems.Add , , RS1!TelNo LV1.ListItems(LV1.ListItems.Count).ListSubItems.Add , , RS1!ClassSched RS1.MoveNext Next N RS1.Close Set RS1 = Nothing End Sub
it seems to have a problem with this line
RS1.Open SQL1, Con, adOpenStatic, adLockOptimistic
so i thought i must make a module that will have this ff. codes..
cuz at first i realized those are not yet declared so...
Public Con As ADODB.Connection Public RS1 As ADODB.Recordset Public Sub Main() Set Con = New ADODB.Connection With Con .Provider = "Microsoft.Jet.OLEDB.4.0" App.Path "\Database\StudentsInfo.mdb;" .Open End With Set SQL1 = New ADODB.Command End Sub
i thought it'll already solve the problem but it still doesn't work. i know i have limited knowledge in database, that's why i might make stupid mistakes here (which i really don't have any clue)
i think my main problem is 'How can i show MS Access File (table) using ListView Control' cuz i thought the first code will already do the trick...
sorry for being inactive in this forum for a long time... and then showing up just because i have a problem >__<
(that's why im really hesitating on posting this~)

New Topic/Question
Reply




MultiQuote


|