多表查询?
请问我想同时查询三个表中的数据,该怎么做?把数据用datagrid控件显示.,运行时提示出错:
该特定字段 'memberuser' 可以参考 SQL 语句中 FROM 子句列表中的多个表。
如下代码错在哪里,请指点!
Dim conn As New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("database.mdb"))
conn.Open()
Dim adt1 As New OleDbDataAdapter("select memberuser as users,carticletitle as wzs,replyuser as repuser,replytitle as rept from members,mainwz,reply where members.id=mainwz.carticleid and mainwz.carticleid=reply.titleid", conn)
Dim ds As New DataSet
adt1.Fill(ds, "members,mainwz,reply") //这里应该怎么写?
dt1.DataSource = ds
dt1.DataBind()
conn.Close()
谢谢了!