
How to bind Parameter Query to Data Control ?
Subject: Re: How to bind Parameter Query to Data Control ?
Quote:
>Does anybody know how to bind a parameter query to a data control?
>I'm trying to use the following code:
Cannot do it.
Quote:
> Dim Db As Database, Q As QueryDef, Ds As Dynaset
> Dim DbName As String, SQL As String
> DbName = "MYDB.MDB"
> Set Db = OpenDatabase(DbName)
> ' Create query
> SQL = "PARAMETERS [Country Name] Text;"
> SQL = SQL & " SELECT * FROM Cntr WHERE((Cntr.country=[Country Name]))"
> Set Q = Db.CreateQueryDef("ParamQ")
> Q.SQL = SQL
> Q![Country Name] = "Austria"
> Set Ds = Q.CreateDynaset() 'This works
> Data1.DatabaseName = DbName
> Data1.RecordSource = Q
> Data1.RecordSource = Q
This needs to be a
SET Data1.RecordSource = Q
which of course is impossible because it is a property, not a variable.
Just rack it up to another SEVERE thing that M$ overlooked.
Quote:
> Data1.Refresh 'And here I get an error message:
_
"640K ought to be enough for anybody." (Bill Gates, 1981)
QWicKeSST - The ultimate database QWK reader, and NO limits. #BLYGJOMK
Special Compile: 1.008A (Alpha)
'[1;35;40m-=> Delphi Internet Jet SST v3.013A (Alpha) - (C) PBE