[AccessD] Calling a stored procedure from Access

JWColby jwcolby at colbyconsulting.com
Thu May 3 23:16:37 CDT 2007


0) I am running the sproc from a query window directly inside of SQL Server.

1) I created the Sproc in Azul/Databases/Infutor/Programability/Stored
Procedures

2) It is giving me that "could not locate entry" error message

3) THAT FIXED IT (I think).  No error and the SP appears to be running.  

It came back awfully quickly though.  15 seconds.  I just recorded the
current record count (properties for the table) and ran the next file and
the row count incremented by the expected value.  This looks like it is
working!  Ant the speed appears to be even faster (14K / second vs 11K /
second).  With speeds like this I can afford to redo the complete count
using my soon to be written code.

Well... Since you da man, how would I return the number of records appended?
I am shooting for a system where an Access (for now) application loads all
of these files automatically, logging that they loaded, the number of
records, moving the files to a backup directory etc.  I have already logged
how many records I converted from raw text to the CSV, so if I can get a
"row count" back, preferably the number appended, but total in the table
would work (I can do the math) then I could log the results to make sure the
same number is appended as are in the CSV file.

And THANKS for your perserverence.  This is my first foray into stored procs
and like all first forays, it hasn't been fun.  In all of the example procs
I have looked at, NONE have tried to do a bulk insert or even handled a file
name.  They all talk about where clauses or building up field in records
or... Anything except what I need to do.

Thanks again,

John W. Colby
Colby Consulting
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Eric Barro
Sent: Thursday, May 03, 2007 11:38 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Calling a stored procedure from Access

Hmmm...how are you running the sproc?

Are you running the sproc in the SQL query window? Or are you calling it
from inside MS Access? Can you verify the following for me?

1. Where did you create the sproc? I have to assume that you created it in
the Infutor database? In SQL server query window it is easy to create the
sproc in the master database.
2. On SQL Management Studio click on the Infutor database and then click New
Query on the toolbar and type this...

EXEC BulkInsertInfutor 'NAR_MT1.csv'

Are you getting an error or is it executing properly?

3. Change exec @SQL to exec (@SQL)




More information about the AccessD mailing list