straight_edge
Member
- Joined
- Feb 21, 2007
- Messages
- 13
- Programming Experience
- Beginner
Hi
I have a problem when joing two tables from an access database
I have two tables 'ServiceUser' and 'SUAttendance' and I need to join them to create a timetable, the tables are joined over SUID and I wish to display the names of the service users attending on a perticular day.
The code below should display in a textbox all of the first names of the service users who attend Mondays AM but it returns an error highlighting
'da.Fill(ds, "DayCareDatabase")' and saying 'No value given for one or more required parameters'.
If anyone can help I would be very grateful
Listing below is my code
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = N:\Yr3\Indv Study\DayCareDatabase.mdb"
con.Open()
sql = "SELECT SU_first_name FROM ServiceUser, SUAttendance WHERE ServiceUser.SUID = SUAttendance.SUID AND Day = 'Mon' and AM = True"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "DayCareDatabase")
con.Close()
txtMonAM.Text = ds.Tables("DayCareDatabase").Rows(0).Item(0)
I have a problem when joing two tables from an access database
I have two tables 'ServiceUser' and 'SUAttendance' and I need to join them to create a timetable, the tables are joined over SUID and I wish to display the names of the service users attending on a perticular day.
The code below should display in a textbox all of the first names of the service users who attend Mondays AM but it returns an error highlighting
'da.Fill(ds, "DayCareDatabase")' and saying 'No value given for one or more required parameters'.
If anyone can help I would be very grateful
Listing below is my code
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = N:\Yr3\Indv Study\DayCareDatabase.mdb"
con.Open()
sql = "SELECT SU_first_name FROM ServiceUser, SUAttendance WHERE ServiceUser.SUID = SUAttendance.SUID AND Day = 'Mon' and AM = True"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "DayCareDatabase")
con.Close()
txtMonAM.Text = ds.Tables("DayCareDatabase").Rows(0).Item(0)