[RESOLVED] How to relate between two tables?
I have table "Pemilik" and "Tanah" . How I can relate both tables using "PLOT" As common field?
Code:
Dim pConn As New ADODB.Connection
pConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DBMS.mdb" & ";Jet OLEDB:Database Password=macres"
pConn.Open
Dim pCommand As New ADODB.Command
pCommand.ActiveConnection = pConn
pCommand.CommandType = adCmdText
pCommand.CommandText = "SELECT Plot,BLOCK,PEMILIK1,PEMILIK2 FROM pemilik"
Dim relTable As New MapObjects2.Table
Set relTable.Command = pCommand
Re: How to relate between two tables?
jone the table on common field "PLOT"
pCommand.CommandText = "SELECT Plot,BLOCK,PEMILIK1,PEMILIK2 FROM pemilik"
pCommand.CommandText = "SELECT tablename.Plot,tablename.BLOCK,tablename.PEMILIK1,tablename.PEMILIK2 FROM pemilik, tanah where pemilik.plot=tanah.plot"