troubleshooting Question

Passing file path as parameter in Access Pass through query

Avatar of Juan Velasquez
Juan VelasquezFlag for United States of America asked on
Microsoft SQL Server
10 Comments1 Solution319 ViewsLast Modified:
Hello,

I've created a number of stored procedures that are called from an Access 2003 front/end via an Access pass-through One such procedure is show below and it is called by pass-through query named "ExportBillingCons" which passes the following code to the MS Sql server "Exec procAppendBillingConsData"  The procedures work fine, however I don't like the fact that the file path argument 'C:\Documents and Settings\velasqj\My Documents\LL VOC Base Line Project Docs\LexusLinkVOC.mdb' in the OPENROWSET function is hard coded.  I want to be able to pass it via the pass-through query using something like the CurrentProject.FileName property.  I'm pretty new to MS SQL server, most of my experience is Access.  Thanks.

Create Procedure procAppendBillingConsData
AS
insert into tbl_BillingCons (BC_FILE_DATE, BC_TYPE, BC_START_DATE,
BC_END_DATE, BC_PACKAGE, BC_VIN, BC_ACCT_SAK, BC_DEALER_ID,
BC_REVENUE_SHARE)
select BC_FILE_DATE, BC_TYPE, BC_START_DATE,
BC_END_DATE, BC_PACKAGE, BC_VIN, BC_ACCT_SAK, BC_DEALER_ID,
BC_REVENUE_SHARE
from OPENROWSET('Microsoft.Jet.OLEDB.4.0','C:\Documents and Settings\velasqj\My Documents\LL VOC Base Line Project Docs\LexusLinkVOC.mdb';;,tbl_BillingCons)
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros