A search has been made for pairs and for single production of scalar leptoquarks of the first and second generations using a data sample of 392 000 Z0 decays from the DELPHI detector at LEP 1. No signal was found and limits on the leptoquark mass, production cross section and branching ratio were set. A mass limit at 95% confidence level of 45.5 GeV/c2 was obtained for leptoquark pair production. The search for the production of a single leptoquark probed the mass region above this limit abd its results exclude first and second generation leptoquarks D0 with masses below 65 GeV/c2 and 73 GeV/c2 respectively, at 95% confidence level, assuming that the D0lq Yukawa coupling αλ is equal to the electromagnetic one. An upper limit is also given on the coupling αλ as a function of the leptoquark mass mD