Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 30th, 2010, 04:06 PM
Registered User
 
Join Date: Aug 2010
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default Calling Stored Procedures from VBA Made Easy?

Hello! My thread title says what I've been looking for. I've seen lots of little bits that have fragments of code in VBA, but I have yet to see a cookbook approach that gives me what I need.I have a stored procedure on my SQL Server 2008R2 system that looks like this:

ALTER proc [dbo].[FindZipInfo]
@ZipIn varchar(10),
@City varchar(20) OUTPUT,
@State varchar (10) OUTPUT,
@Country varchar (16) OUTPUT,
@RecordCount integer OUTPUT
as
SELECT @city = city,@State = state,@Country = country FROM tbl_zipcode WHERE zipcode = @ZipIn
set @recordcount = @@ROWCOUNT

I want to call it from my Access 2010 project's VBA code. I have not found a generic outline of what needs to happen, although I have found many short procedure fragments that I don't have the smarts to pull together into something useful and informative for myself.

I've seen some code that just uses a connection, some that wants a command object, and some that uses a recordset, some differing ways of using parameters (in and output), and I'm not sure that I've uncovered the method (ha ha) behind the madness. Sometimes it feels as though I don't even know enough to be dangerous. Maybe that's really VERY dangerous...

I'm trying to use ADO to do all this. The code would be marvelously helpful, but if you could include some references where the concepts are covered, so I can understand how to feed myself from now on, that would be "wonderfuler."

Thanks!

Duff





Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling procedures in other worksheets pakman Excel VBA 2 July 20th, 2005 08:28 AM
Calling a stored make table query from VBA jas644 Access VBA 0 March 30th, 2005 06:29 PM
Calling AS/400 Stored Procedures from VB.NET prasanthknair ADO.NET 0 January 19th, 2005 06:55 AM
Calling Oracle Stored Procedures booksnore2 General .NET 0 August 24th, 2004 02:08 PM
Calling Stored procedures with out parameters bansalh Access 1 November 25th, 2003 04:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.