Two-dimensional lattices in random potentials characterized by weakly attractive random pinning sites were studied via molecular-dynamics simulations. For a sufficiently high density of pinning sites, a "fragile" glasslike (i.e., amorphous solid) phase is found to be stable at temperatures slightly below the melting temperature. Simulations suggest that this phase can be replaced by a more stable phase, namely, an appproximately long-range-ordered solid phase, as the pins are made less dense and/or with weaker strength. The dynamics of the system depends sensitively on the density of pinning sites. This is probed by studying the velocity autocorrelation function of the particles in a random pinning potential as a function of the density of pinning sites. © 1995 The American Physical Society.