Hi, hope everyone here is dong fine.
Can anyone please help me with my coding.
This is the code to fetch the book name from INPUT box and display it in a TextBox(which is limited). But I want the records to be displayed on a ListView with several others having similar(closest to) name. But I am struggling with the code on how to show the records in ListView.
prompt$ = "Please enter the book name" SearchStr$ = InputBox(prompt$, "book title search") Data1.Recordset.MoveFirst Data1.Recordset.FindFirst "Book_Name='" & SearchStr$ & "'" If Data1.Recordset.NoMatch Then MsgBox "No match found", vbInformation, "" Else Form7.Show Form7.Data1.RecordSource = "select * from Books where Book_Name = '" & SearchStr$ & "'" ‘hope I can use LIKE with % to display more similar names Form7.Data1.Refresh Form7.Text1.Text = Form7.Data1.Recordset.Fields(0) Form7.Text2.Text = Form7.Data1.Recordset.Fields(1) Form7.Text3.Text = Form7.Data1.Recordset.Fields(2) End If
I tried to create the columns using this codes:
ListView1.Columns.Add("Title", 10, HorizontalAlignment.Left)
Which is not working!!
And how do i add the records from the database??
Basically I am struggling with the code to display the records on ListView from the Database. Can anyone please give me some hints.
Thanks a lot.