>Hi all,
>
>I am trying to select record from a table that meet a certain condition
>using a memory variable.
>
>I get this message : "Too many parameters. Expected 1."
>
>Here a sample of my code.
>
>db1.Execute ("select sales.* into saltemp from sales where sales.sale_no=txtsaleno")
>
>Note: txtsaleno=momory variable
>if in place of txtsaleno I put in the actual value it works fine.
>
>I'll appreciate some help.
>Also how can I actually remove deleted records from a table.
>(like pack in VFP)
>
>
>Thanks in advance.
You cannot "Execute" Select queries. You will use the Execute methods with action queries (Insert, Update, Delete).
To retrieve the result of a select query, use OpenRecordset (DAO), OpenResultset (RDO) or Open (ADO).
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com