Ask a Question related to ASP Database, Design and Development.
-
Chris Hohmann #1
Re: VB Functions in Access Module
"Sean S" <sespark@webprod.net> wrote in message
news:00bf01c37257$4b9c1fb0$3501280a@phx.gbl...SELECT> I am using a Access query to select a list of information
> from a table. I use function defined in a vb module in
> the Access database. The function is called in the query
> which is written in the database. The query is called
> qryAction and is as follows:
> PARAMETERS ID Short, Appointment1 Short, DueDateI
> DateTime, Employee Short;
> SELECT Action.*, DerivedDate
> (Action.Month,Action.Day,Action.Minute,Appointment .Meeting
> Time,Action.Prior) AS DueDate
> FROM ((Client RIGHT JOIN Matter ON Client.ClientID =
> Matter.ClientID) RIGHT JOIN Retainer ON Matter.MatterID =
> Retainer.MatterID) RIGHT JOIN (Appointment RIGHT JOIN
> [Action] ON Appointment.AppointmentID =
> Action.AppointmentID) ON Retainer.RetainerID =
> Action.RetainerID
> WHERE blah;
>
> DerivedDate is said function and is as follows:
> Function DerivedDate(ByVal numMonth As Integer, ByVal
> numDay As Integer, ByVal numMinute As Integer, ByVal
> dateOriginal As Date, ByVal boolPrior As Boolean) As Date
> Dim dateNew, floatPrior
> If boolPrior Then
> floatPrior = -1
> Else
> floatPrior = 1
> End If
> dateNew = dateOriginal
> numMonth = numMonth * floatPrior
> numDay = numDay * floatPrior
> numMinute = numMinute * floatPrior
> dateNew = DateAdd("m", numMonth, dateNew)
> dateNew = DateAdd("y", numDay, dateNew)
> dateNew = DateAdd("n", numMinute, dateNew)
> DerivedDate = dateNew
> End Function
Action.*,
DateAdd("m",IIF(Action.Prior,0-Action.Month,Action.Month),
DateAdd("y",IIF(Action.Prior,0-Action.Day,Action.Day),
DateAdd("n",IIF(Action.Prior,0-Action.Minute,Action.Minute),Appointment.
Meeting))) AS DueDate
FROM
..
..
..
Notes:
1. When possible, please avoid the use of "SELECT *". Here's an article
on why: [url]http://aspfaq.com/2096[/url]
2. Consider redesigning the Action table as the values for
Month,Day,Minute and Prior can and should be represented in a datetime
value.
HTH
-Chris
Chris Hohmann Guest
-
Access Module
In searching through all of the linux install/update packages for FMS2, I cannot find examples in any of them of an Access module, as outlined in... -
Access a c++ module from Perl
I am using cygwin and perl and trying to access some function from a C++ windows dll. After the first attempt produced a segmentation fault, I tried... -
new module Logfile::Access
I just uploaded my first perl module, Logfile::Access. Makes parsing access logs very easy. ... -
Unable to access public functions of the objects used as parameters of the web service.
I have a web method as follows: Public Function SearchDocument(ByVal UserLogonName As String, ByVal BusinessName As String,ByVal SearchData As... -
SQL Server - Alternate for First() Last() functions available in MS Access
Hi, I am trying to find out an alternate way to implement the First() & Last() functions (MS Access) in the SQL SELECT statement of SQL Server. ... -
Bob Barrows #2
Re: VB Functions in Access Module
Due to security reasons, you cannot run queries that call custom VBA
functions from external programs: Access must be running in order for them
to run. We've been cursing about this for years, but the security argument
does tend to quell those grumbles.
In addition to custom VBA functions, several builtin VBA functions cannot be
called in jet queries as well.This page contains the list of VBA builtin
functions that can be used in Jet queries run from external applications
such as VB and ASP:
[url]http://support.microsoft.com/default.aspx?scid=kb;en-us;239482[/url]
You are going to have to come up with another way to implement the
functionality of the DerivedDate function.
HTH,
Bob Barrows
Sean S wrote:> I am using a Access query to select a list of information
> from a table. I use function defined in a vb module in
> the Access database. The function is called in the query
> which is written in the database. The query is called
> qryAction and is as follows:
Bob Barrows Guest
-
Sean S #3
Re: VB Functions in Access Module
Thank you very much for your quick reply. :D That's too
bad. :(call custom VBA>-----Original Message-----
>Due to security reasons, you cannot run queries thatin order for them>functions from external programs: Access must be runningsecurity argument>to run. We've been cursing about this for years, but thefunctions cannot be>does tend to quell those grumbles.
>
>In addition to custom VBA functions, several builtin VBAlist of VBA builtin>called in jet queries as well.This page contains theexternal applications>functions that can be used in Jet queries run fromus;239482>such as VB and ASP:
>[url]http://support.microsoft.com/default.aspx?scid=kb;en-[/url]implement the>
>You are going to have to come up with another way toinformation>functionality of the DerivedDate function.
>
>HTH,
>Bob Barrows
>
>Sean S wrote:>> I am using a Access query to select a list ofquery>> from a table. I use function defined in a vb module in
>> the Access database. The function is called in the>>> which is written in the database. The query is called
>> qryAction and is as follows:
>
>.
>Sean S Guest



Reply With Quote

