Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Access 2000 wont let me create functions in MSDE (SQL Server 7)


Message #1 by "Ben Ewards" <ben@c...> on Tue, 21 May 2002 01:29:38
This is driving me nuts.  I am trying to create a function and have tried some VERY simple examples.  I
have been looking in SQL Server 7 help and also tried some of the examples from there.  Could someone please give me an example of a
function that works.  My simple example is

CREATE FUNCTION X1 RETURNS INT
(
RETRUN 1
)

and this gives me the error 'Incorrect syntax nere the word level' in OSQL. 
This word ant even there!

If I try it in access I get 'You cannot change the objexct type in a script'.

Help!
Ben
Message #2 by Barry Dancis <bdancis@c...> on Mon, 20 May 2002 22:03:16 -0400
You are using the C (Oracle?) form of a function. Access and Vb have the
return assigned into the name of the function:

 CREATE FUNCTION X1 as INT
 (
 x1 = 1
 )

----- Original Message -----
From: "Ben Ewards" <ben@c...>
To: "Access" <access@p...>
Sent: Monday, May 20, 2002 9:29 PM
Subject: [access] Access 2000 wont let me create functions in MSDE (SQL
Server 7)


> This is driving me nuts.  I am trying to create a function and have tried
some VERY simple examples.  I have been looking in SQL Server 7 help and
also tried some of the examples from there.  Could someone please give me an
example of a function that works.  My simple example is
>
> CREATE FUNCTION X1 RETURNS INT
> (
> RETRUN 1
> )
>
> and this gives me the error 'Incorrect syntax nere the word level' in
OSQL.
> This word ant even there!
>
> If I try it in access I get 'You cannot change the objexct type in a
script'.
>
> Help!
> Ben
>

Message #3 by "Ben Ewards" <ben@c...> on Tue, 21 May 2002 16:14:19
This gives me 'Incorect Syntax near FUNCTION'. (I am using osql)

)-:
Ben

> You are using the C (Oracle?) form of a function. Access and Vb have the
return assigned into the name of the function:

 CREATE FUNCTION X1 as INT
 (
 x1 = 1
 )

----- Original Message -----
From: "Ben Ewards" <ben@c...>
To: "Access" <access@p...>
Sent: Monday, May 20, 2002 9:29 PM
Subject: [access] Access 2000 wont let me create functions in MSDE (SQL
Server 7)


Message #4 by "Carnley, Dave" <dcarnley@a...> on Tue, 21 May 2002 10:21:03 -0500
public function X1 () as int
	{your code goes here}
end function



-----Original Message-----
From: Ben Ewards [mailto:ben@c...]
Sent: Tuesday, May 21, 2002 11:14 AM
To: Access
Subject: [access] Re: Access 2000 wont let me create functions in MSDE
(SQL Server 7)


This gives me 'Incorect Syntax near FUNCTION'. (I am using osql)

)-:
Ben

> You are using the C (Oracle?) form of a function. Access and Vb have the
return assigned into the name of the function:

 CREATE FUNCTION X1 as INT
 (
 x1 = 1
 )

----- Original Message -----
From: "Ben Ewards" <ben@c...>
To: "Access" <access@p...>
Sent: Monday, May 20, 2002 9:29 PM
Subject: [access] Access 2000 wont let me create functions in MSDE (SQL
Server 7)


Message #5 by Tad Groves <tegrovesjr@r...> on Tue, 21 May 2002 11:07:19 -0700 (PDT)
This should do it.

CREATE FUNCTION x1()
RETURNS int  
AS
BEGIN 
RETURN(1)
END

--- Ben Ewards <ben@c...> wrote:
> This gives me 'Incorect Syntax near FUNCTION'. (I am using osql)
> 
> )-:
> Ben
> 
> > You are using the C (Oracle?) form of a function. Access and Vb
> have the
> return assigned into the name of the function:
> 
>  CREATE FUNCTION X1 as INT
>  (
>  x1 = 1
>  )
> 
> ----- Original Message -----
> From: "Ben Ewards" <ben@c...>
> To: "Access" <access@p...>
> Sent: Monday, May 20, 2002 9:29 PM
> Subject: [access] Access 2000 wont let me create functions in MSDE
> (SQL
> Server 7)
> 
> 


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
Message #6 by "Carnley, Dave" <dcarnley@a...> on Tue, 21 May 2002 14:04:16 -0500
I guess I'm not clear what environment you are trying to create this
function in.  SQl Server 7 has no "Create Function" command.  Does MSDE? I
know VBA/VB does...


-----Original Message-----
From: Tad Groves [mailto:tegrovesjr@r...]
Sent: Tuesday, May 21, 2002 1:07 PM
To: Access
Subject: [access] Re: Access 2000 wont let me create functions in MSDE
(SQL Server 7)


This should do it.

CREATE FUNCTION x1()
RETURNS int  
AS
BEGIN 
RETURN(1)
END

--- Ben Ewards <ben@c...> wrote:
> This gives me 'Incorect Syntax near FUNCTION'. (I am using osql)
> 
> )-:
> Ben
> 
> > You are using the C (Oracle?) form of a function. Access and Vb
> have the
> return assigned into the name of the function:
> 
>  CREATE FUNCTION X1 as INT
>  (
>  x1 = 1
>  )
> 
> ----- Original Message -----
> From: "Ben Ewards" <ben@c...>
> To: "Access" <access@p...>
> Sent: Monday, May 20, 2002 9:29 PM
> Subject: [access] Access 2000 wont let me create functions in MSDE
> (SQL
> Server 7)
> 
> 


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

Message #7 by Tad Groves <tegrovesjr@r...> on Tue, 21 May 2002 14:14:45 -0700 (PDT)
My apologies, I was using MSDE 2000, via Visio 2000, which now supports
user-defined functions.

Product Licensing
Licensing for MSDE 2000 is handled differently according to the
application it accompanies.

Office XP Professional and Visio 2000. A single user license of MSDE
2000 is granted to licensed users of Office XP and Visio 2000. 

Office XP Developer and MSDN Universal Subscription. Developers who
build applications on MSDE 2000 have the right to freely redistribute
MSDE 2000 as stated in the EULA that accompanies Office XP Developer
and MSDN Universal Subscription. 

SQL Server. For each MSDE 2000 deployment that connects to or accesses
data resources of a SQL Server 6.5, SQL Server 7.0, or SQL Server 2000
database, appropriate licensing must be acquired, either by obtaining a
SQL Server CAL for each MSDE 2000 device, or by obtaining SQL Server
Processor licensing for the back-end SQL Server the MSDE 2000 devices
attach to. 

--- "Carnley, Dave" <dcarnley@a...> wrote:
> I guess I'm not clear what environment you are trying to create this
> function in.  SQl Server 7 has no "Create Function" command.  Does
> MSDE? I
> know VBA/VB does...
> 
> 
> -----Original Message-----
> From: Tad Groves [mailto:tegrovesjr@r...]
> Sent: Tuesday, May 21, 2002 1:07 PM
> To: Access
> Subject: [access] Re: Access 2000 wont let me create functions in
> MSDE
> (SQL Server 7)
> 
> 
> This should do it.
> 
> CREATE FUNCTION x1()
> RETURNS int  
> AS
> BEGIN 
> RETURN(1)
> END
> 
> --- Ben Ewards <ben@c...> wrote:
> > This gives me 'Incorect Syntax near FUNCTION'. (I am using osql)
> > 
> > )-:
> > Ben
> > 
> > > You are using the C (Oracle?) form of a function. Access and Vb
> > have the
> > return assigned into the name of the function:
> > 
> >  CREATE FUNCTION X1 as INT
> >  (
> >  x1 = 1
> >  )
> > 
> > ----- Original Message -----
> > From: "Ben Ewards" <ben@c...>
> > To: "Access" <access@p...>
> > Sent: Monday, May 20, 2002 9:29 PM
> > Subject: [access] Access 2000 wont let me create functions in MSDE
> > (SQL
> > Server 7)
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> LAUNCH - Your Yahoo! Music Experience
> http://launch.yahoo.com
> 
> 


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
Message #8 by "Carnley, Dave" <dcarnley@a...> on Tue, 21 May 2002 16:27:39 -0500
sounds very interesting :)

so this function would be written in visio VBA? if so use "public function
X1() as integer" syntax.


-----Original Message-----
From: Tad Groves [mailto:tegrovesjr@r...]
Sent: Tuesday, May 21, 2002 4:15 PM
To: Access
Subject: [access] Re: Access 2000 wont let me create functions in MSDE
(SQL Server 7)


My apologies, I was using MSDE 2000, via Visio 2000, which now supports
user-defined functions.

Product Licensing
Licensing for MSDE 2000 is handled differently according to the
application it accompanies.

Office XP Professional and Visio 2000. A single user license of MSDE
2000 is granted to licensed users of Office XP and Visio 2000. 

Office XP Developer and MSDN Universal Subscription. Developers who
build applications on MSDE 2000 have the right to freely redistribute
MSDE 2000 as stated in the EULA that accompanies Office XP Developer
and MSDN Universal Subscription. 

SQL Server. For each MSDE 2000 deployment that connects to or accesses
data resources of a SQL Server 6.5, SQL Server 7.0, or SQL Server 2000
database, appropriate licensing must be acquired, either by obtaining a
SQL Server CAL for each MSDE 2000 device, or by obtaining SQL Server
Processor licensing for the back-end SQL Server the MSDE 2000 devices
attach to. 

--- "Carnley, Dave" <dcarnley@a...> wrote:
> I guess I'm not clear what environment you are trying to create this
> function in.  SQl Server 7 has no "Create Function" command.  Does
> MSDE? I
> know VBA/VB does...
> 
> 
> -----Original Message-----
> From: Tad Groves [mailto:tegrovesjr@r...]
> Sent: Tuesday, May 21, 2002 1:07 PM
> To: Access
> Subject: [access] Re: Access 2000 wont let me create functions in
> MSDE
> (SQL Server 7)
> 
> 
> This should do it.
> 
> CREATE FUNCTION x1()
> RETURNS int  
> AS
> BEGIN 
> RETURN(1)
> END
> 
> --- Ben Ewards <ben@c...> wrote:
> > This gives me 'Incorect Syntax near FUNCTION'. (I am using osql)
> > 
> > )-:
> > Ben
> > 
> > > You are using the C (Oracle?) form of a function. Access and Vb
> > have the
> > return assigned into the name of the function:
> > 
> >  CREATE FUNCTION X1 as INT
> >  (
> >  x1 = 1
> >  )
> > 
> > ----- Original Message -----
> > From: "Ben Ewards" <ben@c...>
> > To: "Access" <access@p...>
> > Sent: Monday, May 20, 2002 9:29 PM
> > Subject: [access] Access 2000 wont let me create functions in MSDE
> > (SQL
> > Server 7)
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> LAUNCH - Your Yahoo! Music Experience
> http://launch.yahoo.com
> 
> 


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com


  Return to Index