Welcome to HostingForumz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

calling sql function in asp

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Author Message
Alain Bourgeois

External


Since: May 27, 2007
Posts: 3



(Msg. 1) Posted: Sun May 27, 2007 9:11 pm
Post subject: calling sql function in asp
Archived from groups: microsoft>public>inetserver>iis (more info?)

Dear all,

I have a vb function converting date and "time string" to a double:

Function MKDate(d , h )
MKDate = DateSerial(Year(d), Month(d), Day(d))
If (h > "") Then MKDate = MKDate + TimeSerial(CInt(mleft(h, 2)),
CInt(mright(h, 2)), 0)
End Function

If I set this function in a module, I can make
select dt, hour, mkdate(dt, hour)
from appointments
-> It works.

Now I want to use this in asp.

If I set functions in a module, I get an error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Undefined function 'MKDATE' in
expression.
/test/dossier.asp, line 221

I also inserted this function in the .asp file, it compiles but I get
the same run-time error.

Is it possible to call this vb function in sql?


Regards,
Alain

 >> Stay informed about: calling sql function in asp 
Back to top
Login to vote
xundubay

External


Since: May 28, 2007
Posts: 4



(Msg. 2) Posted: Mon May 28, 2007 7:15 am
Post subject: RE: calling sql function in asp [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

can you use variable in the date calculations and assign to the function at
the end

xundubay

"Alain Bourgeois" wrote:

>
> Dear all,
>
> I have a vb function converting date and "time string" to a double:
>
> Function MKDate(d , h )
> MKDate = DateSerial(Year(d), Month(d), Day(d))
> If (h > "") Then MKDate = MKDate + TimeSerial(CInt(mleft(h, 2)),
> CInt(mright(h, 2)), 0)
> End Function
>
> If I set this function in a module, I can make
> select dt, hour, mkdate(dt, hour)
> from appointments
> -> It works.
>
> Now I want to use this in asp.
>
> If I set functions in a module, I get an error:
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
> [Microsoft][ODBC Microsoft Access Driver] Undefined function 'MKDATE' in
> expression.
> /test/dossier.asp, line 221
>
> I also inserted this function in the .asp file, it compiles but I get
> the same run-time error.
>
> Is it possible to call this vb function in sql?
>
>
> Regards,
> Alain
>

 >> Stay informed about: calling sql function in asp 
Back to top
Login to vote
Adam Debowski

External


Since: Jun 05, 2007
Posts: 1



(Msg. 3) Posted: Tue Jun 05, 2007 5:20 pm
Post subject: Re: calling sql function in asp [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

hi,
only access itself can use all functions and other elements from .mdb
database. all other methods (through odbc driver, dao in vb progs etc.)
provide only partial functionality - in example odbc driver handles only
small subset of builtin access functions and custom functions aren't
handled completely. see http://support.microsoft.com/kb/q166113/

rgds,
ad

*** Sent via Developersdex http://www.developersdex.com ***
 >> Stay informed about: calling sql function in asp 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]