  We report on the Submillimeter Array (SMA) observations of molecular lines at
270 GHz toward W3(OH) and W3(H$_2$O) complex. Although previous observations
already resolved the W3(H$_2$O) into two or three sub-components, the physical
and chemical properties of the two sources are not well constrained. Our SMA
observations clearly resolved W3(OH) and W3(H$_2$O) continuum cores. Taking the
advantage of the line fitting tool XCLASS, we identified and modeled a rich
molecular spectrum in this complex, including multiple CH$_3$CN and CH$_3$OH
transitions in both cores. HDO, C$_2$H$_5$CN, O$^{13}$CS, and vibrationally
excited lines of HCN, CH$_3$CN, and CH$_3$OCHO were only detected in
W3(H$_2$O). We calculate gas temperatures and column densities for both cores.
The results show that W3(H$_{2}$O) has higher gas temperatures, and larger
column densities than W3(OH) as previously observed, suggesting physical and
chemical differences between the two cores. We compare the molecular abundances
in W3(H$_2$O) to those in the Sgr B2(N) hot core, the Orion KL hot core and the
Orion Compact Ridge, and discuss the chemical origin of specific species. An
east-west velocity gradient is seen in W3(H$_2$O), and the extension is
consistent with the bipolar outflow orientation traced by water masers and
radio jets. A north-south velocity gradient across W3(OH) is also observed.
However, with current observations we can not assure if the velocity gradients
are caused by rotation, outflow or radial velocity differences of the
sub-components in W3(OH).
