I have this query (qryZipLike) in an MDB file. It accesses a function
geo_distance() and requires input parms for the three parameters.
SELECT tblPrimary.Zip, tblPrimary.State, tblPrimary.City,
geo_distance([@LAT1],[@LON1],tblPrimary.Lat,tblPrimary.Lon) AS dist1
FROM tblPrimary
WHERE Zip Like [@P1];
I am trying to access this query from C# in asp.net using ado.net. I am
really not sure how to do so, but have tried the following code.
OleDbCommand sql1 = new OleDbCommand("qryLikeZip", oleDbConnection1);
theSQL = "SELECT City,Zip,dist1 FROM qryZipLike";
sql1.CommandText = theSQL;
OleDbParameter myparm;
myparm = sql1.Parameters.Add(new
OleDbParameter("@LAT1",OleDbType.Double,8));
myparm.Direction = System.Data.ParameterDirection.Input;
myparm.Value = lat1;
myparm = sql1.Parameters.Add(new
OleDbParameter("@LON1",OleDbType.Double,8));
myparm.Direction = System.Data.ParameterDirection.Input;
myparm.Value = long1;
myparm = sql1.Parameters.Add(new OleDbParameter("@P1",OleDbType.VarChar,4));
myparm.Direction = System.Data.ParameterDirection.Input;
myparm.Value = "030*";
dr = sql1.ExecuteReader();
I get this error at the ExecuteReader call...
Undefined function 'geo_distance' in expression
Can anyone help me with this?