[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

Access DB, function w/n Stored Procedure...?

david

6/15/2005 2:26:00 PM

Hi everyone.

I have read every page that Google returns on this topic, but can't find
anything that resolves my problem.

Basically, I have an Access Database that does a number of different
calculations. One of these calculations is rather complex, and could not be
implemented properly using just nested IIF statements or anything similar, so
was coded using VBA (in the VBE) as a function. This calculation is included
in a query in the database, which calculates a value based on the passed
parameters (a "parameter query"), with the function itself being called as
simply [Accrued]: CalcAccrd(Date,Coupon,Settlement,Maturity, etc..).

This works just fine in Access, with great resuts (i.e. gives right #s).
However, when I try and run this stored query (procedure?) in ASP.net -
ultimately where I had hoped it would reside - I get the error message at the
bottom of this question. In short, it does not recognize the function I try
to pass to it as existing when run from ASP.net.

Any help would be most appreciated. I have tried everything I can think of...

Thanks!

David

ASP.net Error Message
--------------------------

System.Data.OleDb.OleDbException: Undefined function 'JustATest' in
expression. at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult) at
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior,
Object& executeResult) at
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method) at
System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) at
System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior
behavior) at System.Data.Common.DbDataAdapter.FillFromCommand(Object data,
Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet
dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior) at
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at
ASP.plquery_aspx.BindData(String sFilter) in ...

1 Answer

Paul Clement

6/16/2005 2:23:00 PM

0

On Wed, 15 Jun 2005 07:26:06 -0700, "David" <David@discussions.microsoft.com> wrote:

&#164; Hi everyone.
&#164;
&#164; I have read every page that Google returns on this topic, but can''t find
&#164; anything that resolves my problem.
&#164;
&#164; Basically, I have an Access Database that does a number of different
&#164; calculations. One of these calculations is rather complex, and could not be
&#164; implemented properly using just nested IIF statements or anything similar, so
&#164; was coded using VBA (in the VBE) as a function. This calculation is included
&#164; in a query in the database, which calculates a value based on the passed
&#164; parameters (a "parameter query"), with the function itself being called as
&#164; simply [Accrued]: CalcAccrd(Date,Coupon,Settlement,Maturity, etc..).
&#164;
&#164; This works just fine in Access, with great resuts (i.e. gives right #s).
&#164; However, when I try and run this stored query (procedure?) in ASP.net -
&#164; ultimately where I had hoped it would reside - I get the error message at the
&#164; bottom of this question. In short, it does not recognize the function I try
&#164; to pass to it as existing when run from ASP.net.
&#164;
&#164; Any help would be most appreciated. I have tried everything I can think of...
&#164;

Unfortunately the Jet database engine does not support user defined functions in SQL queries
executed via DAO, ADO or ADO.NET. Only the Microsoft Access application provides this capability.


Paul
~~~~
Microsoft MVP (Visual Basic)