sql stored procedure

Could you please tell me the best way to execute an sql stored procedure from 
access and insert the returned records into a local access table. the 
procedure takes one parameter, an as of date. Can I do it with a passthrough 
query, can a passtrough query be an append query? or should I use dao (or 
ado) thanks
0
Utf
12/9/2009 6:06:08 PM
access.modulesdaovba 1670 articles. 0 followers. Follow

1 Replies
558 Views

Similar Articles

[PageSpeed] 42

"James" <James@discussions.microsoft.com> wrote in message 
news:85969E17-518C-4DCC-BD3B-DCBB45F5BBAA@microsoft.com...
> Could you please tell me the best way to execute an sql stored procedure 
> from
> access and insert the returned records into a local access table. the
> procedure takes one parameter, an as of date. Can I do it with a 
> passthrough
> query, can a passtrough query be an append query? or should I use dao (or
> ado) thanks


Without actually trying it, I would guess you could base an append query on 
a pass-through query that executes your stored procedure.  The parameter 
presents a problem, though.  I believe you'd have to modify the SQL of the 
pass-through query in order to specify the parameter as a literal value. 
Only after doing that would you execute the append query.  That means making 
a design change to the stored pass-through query every time you execute it, 
which is not a wonderful thing to be doing.

As an alternative approach, you could use an ADO Command object to execute 
the stored procedure and return a recordset, and then loop through that 
recordset and add each record to your local table.  You'd probably have use 
a second recordset, opened on the local table, to do that.  My guess is that 
this would execute less efficiently than runnng an append query on a 
pass-through query, as described above, but it wouldn't require making 
design changes at run-time.

-- 
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

0
Dirk
12/9/2009 8:13:08 PM
Reply:

Similar Artilces:

Calling Dex Procedures from SQL
Is there any way to call dex procs from SQL or VB code? Jed There is an undocumented and unsupported method of calling Dex code from VBA. However, I know of no method of calling Dexterity from SQL. Please email me if you want an example, just remove the online. from the address below. David Musgrave [MSFT] Senior Development Consultant MBS Services - Asia Pacific Microsoft Business Solutions http://www.microsoft.com/BusinessSolutions mailto:dmusgrav@online.microsoft.com Any views contained within are my personal views and not necessarily Microsoft Business Solutions policy. This p...

is SQL 2000 architecture different SQL Server 2005 / 2008 architecture?
Hi I have a book "inside SQL Server 2000" by Kalen Delaney, which I have been told is a good book. I am going backwards... reading about the sql server architecture in chapter 3 of the book. As I'm reading... I was wondering is it different SQL Server 2000 vs SQL Server 2005/2008? Also where can I find a book/or link that can give me more details about the internals on architecture? Thank you norm (normanchan@gmail.com) writes: > Hi I have a book "inside SQL Server 2000" by Kalen Delaney, which I > have been told is a good book. I am g...

Moving customizations from SQL 2k to SQL 2k5 CRM
This may be a non-issue but I wanted to check to see if anyone has done this and ran into issues. I have the XML customization files from our previous install of CRM 3.0 with SQL 2k database. I now want to import and publish these same customizations to CRM 3.0 on SQL 2k5. Has anyone done this or can point me to documentation that tells about the success or issues for doing this? Thanks. On 7 Feb., 06:35, Chris Treanor <ChrisTrea...@discussions.microsoft.com> wrote: > This may be a non-issue but I wanted to check to see if anyone has done this > and ran into issues. > &...

CRM 3.0 Install Error with SQL Reporting Services and SQL 2005
Hi, Doing a CRM 3.0 Server installation. During the last page of the install wizard (or what I assume is the last page) when I goes through and does verification I get a red X next to SQL Reporting Services. The message I receive when I look at the details is: ***** The specified path is not a metabase path. Parameter name: path ***** Now SRS is installed and working. I put in the URL: http://<servername>/reportserver and every other variation on that I can find. Thoughts? Alan try http://servername/reports also assuming you did not use ssl... =======================...

Does anyone know where the auto recovery file are stored on the?
Looking for an Excel file that was not saved... is there any chance that it is saved somewhere?????? The files that autorecovery creates are deleted when excel closes your workbook successfully. (If excel/windows crashes, excel is smart enough to find those files and offer to open them.) Did excel crash or did you just forget to save? Yeah, sorry. You may want to look into using Jan Karel Pieterse's addin called AutoSafe (note spelling). It doesn't overwrite the existing workbook when it saves. It saves to a user selectable folder. And when it's done, it either deletes the...

sql summarizing help
Hi All, Given: table1 --------- id, cdate, weeksago, amount, typeid, timeclose 496, 2010-02-11, 0, 450, 3, 1 490, 2010-02-01, 1, 200, 4, 1 491, 2010-02-01, 1, 350, 2, 2 493, 2010-02-01, 1, 500, 5, 1 489, 2010-01-21, 3, 150, 2, 1 136, 2010-01-12, 4, 500, 3, 2 137, 2010-01-12, 4, 100, 3, 1 138, 2010-01-12, 4, 500, 2, 1 1. i'm trying to create a sql that will give me a summary resultset grouped by weeksago. 2. i want to sum the columns and get counts based on typeid. 3. avg of timeclose here's the sql i have: select weeksago, , (sum(timeClose)/(count(timeclo...

SQL 'for xml' and C# example??
I'm missing some piece of the puzzle. I'm using 'for xml' type queries from SQL2K - and now trying to change the front-end from ADO to C#, I can't quite figure it out.. It seems that I could use an XmlReader.. and somehow use that instead of a DataReader.. but that didn't work.. I tried using a DataReader and get the byte array - but that wasn't right. SQL returns formatted XML, I need to load that XML into an XmlDocument somehow without ANY molestation of that dom. Any ideas? Examples? Missing links???? thanks THANKS!! I've been looking for the answer to ...

question about moving mailboxes from 2000 exch to 2003 exchange and mail store size
we are finishing up moving all of our mailboxes from our old exchange 2000 server to our new exchange 2003 server. I was researching the registry change you have to make to enable up to a 75 gig mail store with exchange 2003 sp2. When I look at the registry for our exchange 2003 server I only see the key for the PUBLIC store. The PRIVATE does not appear. is this because we have not moved all of our mailboxes and so have not removed the exchange 2000 server yet? I wasnt going to make the registry change yet, just researching so I can do this when we finished moving the rest of the mai...

Update multivalue field in table from form with SQL
Access 2007 on Vista I am using a form to establish the variables for a report before it is created. One field on the underlying table is a multivalue field, and the form includes a multi-select combo box control. After selections are made and the OK button on the multi-select combo drop down is clicked, focus moves to the next control. I have discovered though, that the underlying table does not update immediately, but does so correctly when I close the form. This sequence does not deliver the proper report data, so I need a way to immediately update the underlying table (m...

Refer to SQL statements globally
I have two large SQL statements that I need to use across several forms, reports, etc. Rather than repeat them in each form, I'm trying to store and reference them globally. For example, I'd like to store strSQL1 and strSQL2 in a global module, so I can use either like this in a form: Random form: Me!lstResults.RowSource = strSQL1 Random report: Me.Report.RecordSource = strSQL2 Would I just store the SQL statements in a global module like: Public Function SQLSource() As String Dim strSQL1 As String Dim strSQL2 As String strSQL1 = "SELECT blah blah...

To SQL or not to SQL?
I have a very vertical product developed 100% in M/S Access. I developed it myself in 1993 in the initial release of Access and been with it ever since. It is currently very stable and running in Access 2003. My big question is how or even *if* we should move it to SQL. My customers are getting bigger all the time with more users. Typically our customers run one or two workstations generally never more than 5. Performance, however, is starting to slow with database sizes passing 500 meg. We also have a LOT of code behind forms so are bound tightly to the Access development environ...

PostgreSQL or other SQL servers in RMS
Has anyone successfully implemented RMS with one of the free SQL servers? Theoretically, is there any reason why we have to use MS SQL Server 2000 for large databases? David "dh" <dh@discussions.microsoft.com> ha scritto nel messaggio news:1783A90D-AF3E-4D91-A445-0039D4E7E379@microsoft.com... > Has anyone successfully implemented RMS with one of the free SQL servers? > Theoretically, is there any reason why we have to use MS SQL Server 2000 > for > large databases? RMS has implemented only for MS SQL Server (2000/MSDE) and isn't possible to work with ano...

writeback to SQL 2005
hello! I use excel 2007 iI open a connection agianst SQL server 2005 and choose a table. In my workbook i can now see this data from this table. if i change a value in some cell i wish to writeback to table in SQL server. Is this possible? It's possible through the use of VBA and ADO, but not simply using the data connection you've already established. Ross "CJ" <CJ@discussions.microsoft.com> wrote in message news:D54EC521-0DD5-4B3D-971B-4FF3394D6FA8@microsoft.com... > hello! I use excel 2007 > iI open a connection agianst SQL server 2005 and choose a table...

RE: Can I create a command box fora macro to be stored on my toolbar
You may want to check here for more information. http://www.cpearson.com/Excel/menus.htm In the future, please post more information in the message section when you post your question. HTH, Barb Reinhardt ...

sql.request #2
Does anyone have a comprehensible guide on how to use it that a dolt like me can follow? Every time I try I get a #N/A. The only guide I can find is at http://www.bygsoftware.com/examples/zipfiles/UsingSqlRequest.zip but it's really hard to follow. From the MSDN Library: http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/office97/html/SEC41.asp Not sure how familiar you are with ODBC; but if you are getting #N/A as a result, it is usually because of problems either with the SQL syntax or the connection string. There are a few examples of connection strings in the re...

MSDE or SQL Personal or SQL Developer? or SQL Workstation?
Hi, which one is better for personal non-server computer? MSDE? SQL Personal? SQL Developer? SQL Workstation? Thank you. It depends on what edition of GP you are going to run. If you are going to use Professional, you need to go with SQL Server developer, assuming you are installing on a non-server OS. "ano" wrote: > Hi, which one is better for personal non-server computer? MSDE? SQL Personal? > SQL Developer? SQL Workstation? > Thank you. Is the function of SQL Developer the same as Enterprise edition? How about personal edition? Can it be used for GP Pro? Can dev...

Best POS/Inventory System for Grocery Stores #2
Hi All, I was wondering what in your opinioin is the best POS/Inventory system out there. And how does RMS rank up? Thank you My apologies for the identical messages! I was having connection problems and got errors after pressing the Send button. Obviously it got posted multiple times. "Tom Bombadil" <Genius_Poster@Yahoo.com> wrote in message news:219DB89A-D8E0-4926-8762-4B3107C0635B@microsoft.com... > Hi All, > > I was wondering what in your opinioin is the best POS/Inventory system out > there. And how does RMS rank up? > > Thank you This woul...

Excel RoundUp in Transact-SQL
Last week I posted the following computation in Excel... roundup(roundup(rate * 500),4) - roundup(rate * 200,4) + polfee,2) ((6.108934 * (500000/1000)) - (200 * 6.108934) + 1311.51) = 3144.20 In SQL using round(num,4) = 3144.19 I've moded this to... round(num+0.0005,4) = 3144.20 This works most of the time but occasionally I'm still off from what Excel returns. I'm under 2% in my 342 calcs, so it's do-able and we'll explain if any client notes this that we've reduced their pmt by .01 cents. BUT, I'd still like a way to replicate Excel'...

Access frontend with SQL Server backend: my solution for ODBC Call error
Hi This thread follows threads I started in forums microsoft.public.access.forms, and microsoft.sqlserver.programming: 1. 'Overriding constraint violation message' at 21.04.2010 12:00; 2. 'Overriding constraint restriction message, when deleting record(s) from form' at 29.04.2010 10:36. The problem (Occurs in Access 2000 mdb as stated by MS and in Access 2007 mdb as I myself discovered): When record operation is aborted from SQL Server, Access gets the full information about error, but this info gets unaccessible at moment when OnError event is triggered. The...

GP 9.0 on SQL 2008
MBS has said GP 10 is supported on SQL Server 2008. However there is no information on support for GP 9.0 on SQL 2008. Does anyone have any real-world experience running GP 9.0 on SQL 2008 in a production environment? Thanks, John Dynamics GP 9.0 is not supported on Microsoft SQL Server 2008. This is an excerpt from the System Requirements page. Database Requirements: MSDE 2000 SP 4 Microsoft SQL Server 2000 Enterprise Edition SP 4 Microsoft SQL Server 2000 Standard Edition SP 4 Microsoft SQL Server 2000 Workgroup Edition SP 4 Microsoft SQL Server 2000 (64-bit) SP 4 Microsoft SQL Serve...

SQL
Hi, i am new in Sql express i am trying to create a database in sql but i dont now how can i install the database in other computer or a server programmatically where the other computer have the sql and if is a server what i nead to do . or only what i need is a valid conection ; i use the localhots to identify any clinte machine but i dont now what i need to writh for the servers my conection is look like this as a defualt from MFC hr = _db.OpenFromInitializationString(L"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Data.mdf;Data Sour...

SQL Study Group
sql-study-group@googlegroups.com Please join for support our SQL Study Group ------=_NextPart_0001_3CECC08E Content-Type: text/plain Content-Transfer-Encoding: 7bit For those who want to join, the URL is http://groups.google.com/group/sql-study-group David Musgrave [MSFT] Escalation Engineer - Microsoft Dynamics GP Microsoft Dynamics Support - Asia Pacific Microsoft Dynamics (formerly Microsoft Business Solutions) http://www.microsoft.com/Dynamics mailto:David.Musgrave@online.microsoft.com http://blogs.msdn.com/DevelopingForDynamicsGP Any views contained within are my personal views a...

Store Operations Manager error ( rms 1.2)
After reloading sql on server (Hard Drive Crash) som gives error cannot connect to database. I can open Store Operation Administrator and connect with no issue but cannot open som. Any idea's? Thanks Jaymes Jaymes wrote: > After reloading sql on server (Hard Drive Crash) som gives error cannot > connect to database. I can open Store Operation Administrator and connect > with no issue but cannot open som. Any idea's? Check the database with Store Op. Administrator.. do you are sure that the database is correct now? cod yes the soa can connect and pos systems work &qu...

SQL 2008 and SRS
I am using SQL 2005 with CRM 4.0 on one box and have to move CRM and SQL to seperate boxes. The SQL box will have SQL 2008 Standard. The consultant who will be doing the SQL work reminded me to install SRS. Is SRS included with SQL 2008 Standard? Thanks, John SQL Server Reporting Services (SSRS) is part of 2008 Standard Edition. RLF "John" <bsmith@aol.com> wrote in message news:%23DpI1bfcKHA.808@TK2MSFTNGP02.phx.gbl... >I am using SQL 2005 with CRM 4.0 on one box and have to move CRM and SQL to >seperate boxes. The SQL box will have SQL 2...

multiple stores
we are currently using rms in our museum store. Now we want to sell tickets and be able to use the system at our admissions desk. is there a way to keep items separate or does the 2nd store use the same database? would it be better to purchase another entire system so the store items would remain secure or is there a way to add the 2nd store and keep people out but still be able to have the front desk people able to get their own reports, etc. Any help would be appreciated! -- Ellan Burke Mayborn Museum Store Waco, TX Are you already using a HQ environment? If so, then you would open ...