PDA

Click to See Complete Forum and Search --> : Pass parameter


gshabtay
Nov 2nd, 2000, 03:32 PM
I write this SQL quary :

PARAMETERS Parametr Text ( 255 );

SELECT tbl1.code, tbl1.Desc
FROM tbl1
WHERE tbl1.Desc Like "*" & [Parametr] & "*";

it works very well in Access. but when I pass the parameter with VB I got an empty recordset , can you help me with it ?

Bigley
Nov 2nd, 2000, 04:28 PM
I'm not sure but you could try % instead of *

gshabtay
Nov 3rd, 2000, 04:58 PM
Thanks but it did not work.

sundarv
Nov 4th, 2000, 01:00 AM
use like " & somevariable& "*'"

this will work i think

thanx and regards
sundar

gshabtay
Nov 5th, 2000, 02:38 AM
Sorry about my last message , its working now
here is the right way to do it (like Bigley told me to do , so thanks to him )

PARAMETERS Parametr Text ( 255 );

SELECT tblTreeDesc.TreeCodeDesc, tblTreeDesc.TreeDesc
FROM tblTreeDesc
WHERE (((tblTreeDesc.TreeDesc) Like ("%" & [Parametr] & "%")));