Results 1 to 4 of 4
  1. #1
    Freq is offline Novice
    Windows 7 Access 2007
    Join Date
    May 2010
    Posts
    2

    Need help converting sql server stored procedure to access

    I am converting a sql server based app to access.
    I was calling sql server stored procedures from a .Net application to do a time stamp.

    Below are the stored procedures I was using in sql server. I'd like to be able to do the
    same using access.

    set ANSI_NULLS ON


    set QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[saClockIn] @EmployeeID int AS BEGIN INSERT INTO SaTimeTransactions (TransactionDate, EmployeeID, TimeIn) VALUES (convert(char(10),getdate(),121), @EmployeeID, GetDate()) End

    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[saClockOut] @ID int, @Minutes int, @Hours int AS BEGIN UPDATE SaTimeTransactions SET TimeOut= getdate(), Minutes = @Minutes, Hours=@Hours WHERE ID=@ID End

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,774
    Where are you stuck? The equivalent of GetDate() in Access is Now(). Access also has Date() and Time(), if you just want those components. The input parameters in Access would typically come from a form, where the user would input the values on a form and the query would get them from there.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Freq is offline Novice
    Windows 7 Access 2007
    Join Date
    May 2010
    Posts
    2
    Quote Originally Posted by pbaldy View Post
    Where are you stuck? The equivalent of GetDate() in Access is Now(). Access also has Date() and Time(), if you just want those components. The input parameters in Access would typically come from a form, where the user would input the values on a form and the query would get them from there.
    Well, I want to be able to call the equivalent of a stored procedure in access from an external .Net app. I want Access to handle stamping the date/time in a table, but I want that code to be triggered externally.

    From within the external app, I was running the following tSLQ statement .. "Exec spClockIn " & intEmployeeIDClicked

    I need to do the equivalent in access.

  4. #4
    evander is offline Competent Performer
    Windows 7 Access 2003
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    206
    Freq,

    I think you can use the @ parameters in Access just like in SQL Server, although you don't need to declare them (I think). You can use Wrox VB database programming by Willis. I saw such code in that book.

    Good luck.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 05-12-2010, 09:41 AM
  2. Pass image parameter to stored procedure
    By Kencao in forum Programming
    Replies: 3
    Last Post: 04-28-2010, 11:51 PM
  3. Passing variable values to Stored Procedure
    By rodrigopcnet in forum Access
    Replies: 1
    Last Post: 04-14-2010, 10:35 AM
  4. Replies: 0
    Last Post: 10-04-2009, 04:11 AM
  5. stored procedure return value to access form
    By rbw940 in forum Programming
    Replies: 0
    Last Post: 10-13-2008, 01:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums