473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Can I call a SQL Server 2000 User-Defined Function from Access 2003?

Does anyone know if this can be done?
Nov 13 '05 #1
4 6598
yes, just create a pass-through query in the query builder and put in

exec sp_yourProc

Then,

currentdb.Execute "yourqueryName"

Can't remember..but you might need:
exec "sp_YourProc" in the query...

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.attcanada.net/~kallal.msn
Nov 13 '05 #2
So I assume for a function it would look something like:

intSomeValue = Exec dbo.fncCalcValue???

Since it's returning a value you can't use .Command or .Execute

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3
Ah, ok....was under the impression you just wanted to run a stored proc.
(not return values from a t-sql function)

If you are going to return a value...then you can just use a reocrdset....

You can still use a pass-through query...but you just take the results form
a reocrdset.
dim rstData as dao.recordset
set rstData = currentdb.OpenRecordSet("YourPassThrouthQueryNameG oesHere")

msgbox "return value = " & rstData(0)

However, you are much better off to use a ADO connection for this. In fact,
you can execute any procedure via the connection object...and not even have
to use a pass through query.

MyADOConnection.YourProcName

So, here is some ado examples...as I don't feel comfortable suggesting to
use dao to grab data from a function on sql server.

http://msdn.microsoft.com/library/de...parameters.asp

Also, since you are not talking about using a storeed procedure..but a t-sql
defined function, then I might be miss-understanding your question.
(you likey have to create a stored procedure that uses that fucntion...and
return values that way).

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.attcanada.net/~kallal.msn
Nov 13 '05 #4

Thanks for the help. Using ADO with a SP which runs my SQL user-defined
function works. Thanks for the idea and help.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Chris Halcrow | last post by:
Hi I've spent ALL DAY trying to re-install SQL Server 2000 on Windows XP. I continually get the error 'cannot configure server' just at the end of the installation. I've tried the following: ...
1
by: Chris | last post by:
I try to read a shared directory. This shared directory is on a 2000 server. When I use DirectoryInfo.Exists, I always have "This directory does not exist". If the shared directory is on a...
1
by: RSH | last post by:
Im trying to create a stored procedure of the following code. I want to set it so that I have to send the first 4 variables (@DB, @BackUpFile,@TestDB,@RestoreFile). I am having trouble when i try...
1
by: Parv | last post by:
I am trying to impersonate user to some other system using userName,domainName,password in C#. My Code is working fine if i am working on Windows 2000 professional after assigning current user "Act...
2
by: sqlgirl | last post by:
Hi, We have 2 servers. Server1 is a 2000 box, with SP3 (yes I know it is not up to date). Server2 is a 2005 box, SP2. I set up Server1 (2000) to have a linked server to Server2 (2005). The...
5
by: OJ | last post by:
Hi, I am at a loss here, I have a c# asp.net website which connects to a remote SQL Server 2000 db via a connection string. If I set the website up in the filesystem and use the inbuilt cassini...
1
by: Myster Edd | last post by:
I have a strange problem that I think deals with security on SQL 2005. I have a scheduled task that runs on a Windows 2000 machine. It calls a vb script which creates a connection to SQL Server. ...
3
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
Last week I asked a question about connection to database from client machine (developer machine). I have changed the database security setup for "SQL Server and Windows" under (local)Windows NT...
1
by: nano2k | last post by:
Hi I have a pretty serious problem. I have developed a winforms app that calls a webservice using .NET Framework 1.1 with C#, IIS 5.1. and SQL Server 2000 server. After installing the WS, I...
10
by: Scott M. | last post by:
I've seen many posts and ready articles discussing how changing the membership & roles "provider" in VS .NET is easy, but have yet to see instructions on how to do it. If I already have SQL...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.