Creating a tped DataSet for dbase files - Parameters question

  • Thread starter Thread starter Mircea Ion
  • Start date Start date
M

Mircea Ion

I have an ODBC connection to a folder where a few dbf files reside.
In Visual Studio I'm trying to create a DataSet for this table ZIPS with the
following fields:
ZIP char
PROV char
CITY char

The default Fill and GetData using a SELECT zip, prov, city FROM zips are
created fine, no problem.
Now, let's say I'm trying to create FillByCity and GetDataByCity. In the
query builder I'm constructing
a string like: SELECT zip, prov, city, FROM zips WHERE city = '@city' AND
prov = '@prov'
Executing the query immediately returns a single record populated with nulls
without asking me for values for those parameters.
Of course the query works if I use actual values as parameters.

Is there a different syntax?. Can someone help?

Thank you.
 
I have an ODBC connection to a folder where a few dbf files reside.
In Visual Studio I'm trying to create a DataSet for this table ZIPS with the
following fields:
ZIP char
PROV char
CITY char

The default Fill and GetData using a SELECT zip, prov, city FROM zips are
created fine, no problem.
Now, let's say I'm trying to create FillByCity and GetDataByCity. In the
query builder I'm constructing
a string like: SELECT zip, prov, city, FROM zips WHERE city = '@city' AND
prov = '@prov'
Executing the query immediately returns a single record populated with nulls
without asking me for values for those parameters.
Of course the query works if I use actual values as parameters.

Is there a different syntax?. Can someone help?

Thank you.

I'm not sure what syntax xbase supports for parameters, but you can try
removing the quotes from around '@city' and '@prov' for a start
 
odbc and oledb queries don't allow named parameters. Instead
you should use "?" on the place of parameters in query.

-sudhakar
 
Back
Top