--- In [email protected], "swzoh" <[EMAIL PROTECTED]> wrote:

I was too enthusiastic to realize that there was no way for handles
created meanwhile to be released automatically. So, I have to rewrite it:

----------------------------------------------------------------------
@DAO
args query,dao,db,rs,rc,wName,wMean
dao=com.create_object("DAO.dbEngine.36")
db=dao.OpenDatabase(?"C:\path\dictionary.mdb")
rs=db.OpenRecordset;;+
("SELECT * FROM dictionary WHERE word = "++?'"'++query++?'"')
if(rs.BOF && rs.EOF)do
osd.show("No Match!")
else
rs.MoveLast
rc=rs.RecordCount
rs.MoveFirst
for(local i=1;i<=rc;i=i+1)
wName=rs.Fields(0)
wMean=rs.Fields(1)
clip.set(wName.Value++" <=> "++wMean.Value,1)
wName=wName.release
wMean=wMean.release
rs.MoveNext
endfor
endif
rs.close
db.close
quit

@ADO
args query,rs,rc,wName,wMean
rs=com.create_object("ADOdb.Recordset")
rs.open("dictionary WHERE word = "++?'"'++query++?'"',;;+
?"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=;;+
C:\path\dictionary.mdb",1,-1,-1)
if(rs.BOF && rs.EOF)do
osd.show("No Match!")
else
rs.MoveLast
rc=rs.RecordCount
rs.MoveFirst
for(local i=1;i<=rc;i=i+1)
wName=rs.Fields(0)
wMean=rs.Fields(1)
clip.set(wName.Value++" <=> "++wMean.Value,1)
wName=wName.release
wMean=wMean.release
rs.MoveNext
endfor
endif
rs.close
quit
----------------------------------------------------------------------

Sean






Attention: PowerPro's Web site has moved: http://www.ppro.org



SPONSORED LINKS
Computer monitoring software Power pro Computer and internet software
Free computer monitoring software


YAHOO! GROUPS LINKS




Reply via email to