excel vba runtime error 3704 Crete Nebraska

Address 841 210th, Milford, NE 68405
Phone (402) 761-3623
Website Link http://www.polarcomputerusa.com
Hours

excel vba runtime error 3704 Crete, Nebraska

Do you have a check to make sure that the query is returning at least 1 record? Reply With Quote May 16th, 2009,12:51 PM #7 Siddharth Rout View Profile View Forum Posts Visit Homepage Super Moderator Join Date Feb 2005 Location Mumbai, India Posts 11,940 Re: VBA-Excel error So, I have subjects mistake when I execute following code in Excel 2003: Code: Private Sub CommandButton1_Click() Dim sDate1 As String Dim sDate2 As String Dim sClid As String sDate1 = Here is my code: VB: Sub DownloadData() Dim sedol As String Dim iNoPeriod As Integer Dim adoRs As ADODB.Recordset Dim adoComm As ADODB.Command Dim arrDates(100) As Variant Dim iCtr As Integer

Posts: 432 Thanks: 0 Thanked 1 Time in 1 Post Before I begin I have to point out I am not an SQL Programmer. The main problem still is that the recordset closes itself immediately after being opened. The parameters passed 'NameProcedure'(name of the stored procedure in SQL) and 'Parameter' comes from other modules which calls this module to execute on SQL. New tech, old clothes What does a well diversified self-managed investment portfolio look like?

This post has been edited by maj3091: 19 May 2012 - 01:33 AM Was This Post Helpful? 0 Back to top MultiQuote Quote + Reply #5 doty New D.I.C Head Removing elements from an array that are in another array Can an ATCo refuse to give service to an aircraft based on moral grounds? What is that the specific meaning of "Everyone, but everyone, will be there."? Your initial error indicated the connection to the DB was closed. 2.

When posting or responding to questions please remember our values at Chandoo.org are: Humility, Passion, Fun, Awesomeness, Simplicity, Sharing Remember that we have people here for whom English is not there To start viewing messages, select the forum that you want to visit from the selection below. Powered by vBulletin Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. Dim cnn As ADODB.Connection Dim rst As ADODB.Recordset Dim Parameter As String Set cnn = New ADODB.Connection 'Create Connection Set rst = New ADODB.Recordset 'Create Recordset With cnn cnn.Open "Provider=SQLOLEDB; "

asked 2 years ago viewed 2849 times active 2 years ago Visit Chat Related 0VBA/ADODB Run-Time Error: 37040Paste VBA recordset into excel?0Excel VBA error 3704 operation not allowed when object is more hot questions question feed default about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation need book id, written before 1996, it's about a teleport company that sends students learning to become colonists to another world Is it possible to have a planet unsuitable for agriculture? SP uses table variables.

I'll edit my example accordingly. –user3508511 Apr 7 '14 at 21:13 What is the error message you get? –Tim Williams Apr 7 '14 at 21:15 "Operation is This is a sharing forum, so please keep things in the post. With the passing of Thai King Bhumibol, are there any customs/etiquette as a traveler I should be aware of? The command text I use works fine in SQL server but once I put it into this macro it fails to retrieve the recordset.

You may have to register before you can post: click the register link above to proceed. You have to open the connection first... Please help. The time now is 01:38 AM.

Even when i run the Stored procedure on SQL, it is working fine. I get the error in just a few seconds of clock time so I am sure that this is not a problem with my connection timing out. The only difference between when it worked previously and now is that my sql statement starts off building a table for the dates and then makes some joins from a few Changed the connection string to: Driver={SQL Server Native Client 11.0};Server=XXXX;Database=XXXX;Trusted_Connection=yes; Now everything works.

Physically locating the server Players stopping other player actions Determine if a coin system is Canonical more hot questions question feed default about us tour help blog chat data legal privacy Narayan NARAYANK991, Apr 1, 2014 #3 Luke M likes this. (You must log in or sign up to reply here.) Show Ignored Content Share This Page Tweet Your name or email The error occurs instantaneously upon hitting the line in question. Auto Merged Post;Ah...

What is a type system? (KevinC's) Triangular DeciDigits Sequence Is it appropriate to tell my coworker my mom passed away? Don't paste the password for your sa account in a public forum ;) –cboden Nov 26 '15 at 10:48 Hi thanks for the response. Reply With Quote May 15th, 2009,05:47 AM #5 krishna1985 View Profile View Forum Posts Thread Starter New Member Join Date May 2009 Posts 4 Re: VBA-Excel error 3704- operation is not We are here to make you awesome in Excel.

Since the query inside it was throwing an error, the front end Excel (macro) immediately caught that error and the record set object was closed. When I run the macro from Visual Basic Editor in Excel I can see my sp firing in SQL Profiler. What does a well diversified self-managed investment portfolio look like? Reason: Auto Merged Doublepost Excel Video Tutorials / Excel Dashboards Reports Reply With Quote Quick Navigation Excel and/or SQL Help Top Site Areas Settings Private Messages Subscriptions Who's Online Search Forums:

Not sure whether the problem is with my VBA code or in my stored procedure. Before you post your first question, please read this short introduction guide. It then drops the redundant tables at the end of the sql statement. Results 1 to 7 of 7 Thread: Ado In Vba Sql Getting Run-time Error Thread Tools Show Printable Version Search Thread Advanced Search December 21st, 2007 #1 londonjer View Profile

However I still get the same error on the line: ActiveCell.CopyFromRecordset adoRs I believe it has something to do with the Sql statement. So Dim i, j As Integer declares i as the default type of Variant (messy, inefficient) and j as an Integer. Contact Us Help Home Top RSS Terms and Rules Privacy Policy Forum software by XenForo™ ©2010-2013 XenForo Ltd. Is it "eĉ ne" or "ne eĉ"?

Any idea why that is?j Next, vb6 doesn't allow you to comma-separate a bunch of declared variables and set their type at the end. Browse other questions tagged excel vba sql-server-2008 excel-vba or ask your own question. You say when removing the CURSOR statement the error is fixed. I have researched the error and the only solutions I have seen have to do with the connection timing out.

I've tried to search for a solution but couldn't find anything relevant.