I want a button click event to do this:
can i use "UNMATCHED" keyword in the same SQL Statment using a UNION ?
pls help me with this!! table1 is my master Db and table2 is my work DB.. both have same columns expect that primary key in both tables is serial number..
I want to display all records in an excel spreadsheet but I want all those values in table2 which exist in table1 as bold and those which do not in plain text..
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con As OleDbConnection = New OleDb.OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=C:\Documents and Settings\bashkark\Desktop\Final Database.mdb")
Dim cmd As New OleDbCommand
cmd = New OleDbCommand("select table2.MFG MATCH as 'DELL' or 'HP from table2,table1 where table1.MFG=table2.MFG", con)
con.Open()
Dim da As OleDbDataAdapter = New OleDbDataAdapter(cmd)
Try
Dim ds As DataSet = New DataSet()
ds.Tables.Add("table2")
da.Fill(ds, "table2") // [B]i get error here.."[U]Ierrorinfo.getdescription.failed with E_FAIL(0X80004005)[/B]) [/U]
DataGridView2.DataSource = ds.Tables("table2").DefaultView
Finally
con.Close()
cmd = Nothing
da.Dispose()
con.Dispose()
End Try
End Sub
End Class