error 3704 operation not allowed when object is closed
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the
Run-time Error 3704 Operation Is Not Allowed When The Object Is Closedworkings and policies of this site About Us Learn more about operation is not allowed when the object is closed sql Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions run-time error '3704' application-defined or object-defined error Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
Error 3704 TeradataJoin them; it only takes a minute: Sign up run-time error '3704' operation is not allowed when the object is closed in VB6 while using SP using temp tables up vote 3 down vote favorite I am using the Stored procedure "sp_Missingdata" to get the data and to display in the MSFlexGrid, But i am getting the error as
Operation Is Not Allowed When The Object Is Closed Vb6- run-time error '3704' operation is not allowed when the object is closed I searched in google a lot and changed these things - 1. set NOCOUNT ON for the Stored procedure. 2. set SET ANSI_WARNINGS OFF for stored procedure. Private Sub Command2_Click() Dim cmd As ADODB.Command Dim sqlnew, dd Set cmd = New ADODB.Command cmd.ActiveConnection = ArtmConn cmd.CommandType = adCmdStoredProc cmd.CommandText = "sp_missingData" Dim rsnew As ADODB.Recordset Set rsnew = New ADODB.Recordset Set rsnew = cmd.Execute If Not rsnew.EOF Then <-- Error is occuring here Set tblSop.DataSource = rsnew End If rsnew.Close Set rsnew = Nothing End Sub Note- My SP is using the temp table- here is my sp SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET NOCOUNT ON GO SET ANSI_WARNINGS OFF GO ALTER procedure [dbo].[sp_missingData] --exec [sp_missingData] as begin delete from tbl_missingData select ol_code as outletNo, start as StartreceiptNo into #temp from (select l.s_ol_code as ol_code, l.sno + 1 as start from vSalesNo as l left outer join vSalesNo as r on l.sno + 1 = r.sno and l.s_
Page 1 of 1 New Topic/Question Reply 6 Replies - 21057 Views - Last Post: 30 August 2010 - 06:34 PM Rate Topic: #1 operation is not allowed when the object is closed vbscript phreanz_44 New D.I.C Head Reputation: 0 Posts: 3 Joined: 07-March 10
Run Time Error 3704 In SpectrumError 3704 Operation is not allowed when object is closed Posted 29 August 2010 - 03:08 AM 3704 error 'here is what i have: connect On Error GoTo errr: rs.Open "select * from NMCDatabase where StudentNumber = '" & DataGrid1 & "'", cn, 3, 3 If MsgBox("Are you http://stackoverflow.com/questions/14950443/run-time-error-3704-operation-is-not-allowed-when-the-object-is-closed-in-vb6 sure you want to delete this " & DataGrid1.Text & " and all related records?", vbQuestion + vbYesNo, "Delete?") = vbYes Then Adodc1.RecordSource = "delete from NMCDatabase where StudentNumber = '" & DataGrid1.Text & "'" Adodc1.CommandType = adCmdText MsgBox "Deleted!", vbInformation, "deleted!" Adodc1.Refresh DataGrid1.Refresh End If If rs.State = 1 Then cn.Close End If Exit Sub If rs.State http://www.dreamincode.net/forums/topic/188195-error-3704-operation-is-not-allowed-when-object-is-closed/ = 1 Then cn.Close End If errr: MsgBox "Error occured! " & Error, vbExclamation, "Error" & Err.Number If rs.State = 1 Then cn.Close End If End Sub this is what i have on my module: Public cn As New ADODB.Connection Public rs As New ADODB.Recordset Public Sub connect() cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & App.Path & "\StudentInfoSystem_db.mdb" cn.CursorLocation = adUseClient End Sub Public Sub disconnect() If rs.State = 1 Then cn.Close End If End Sub 'my only problem here is that the datagrid is not refreshing everytime i delete some record after clicking the 'command button (cmdDelete) 'it has error that says : operation not allowed when obect is closed, error 3704.... 'tnx This post has been edited by phreanz_44: 30 August 2010 - 12:30 AM Reason for edit:: Added code tags. Is This A Good Question/Topic? 0 Back to top MultiQuote Quote + Reply Replies To: Error 3704 Operation is not allowed when object is closed #2 Ahmedn1 D.I.C Addict Reputation: 23 Posts: 564 Joined: 04-August 09 Re: Error 3704 Operation
Forums Excel Questions SQL via VBA error: Operation is not allowed when the object is closed Page 1 of 3 123 Last Jump http://www.mrexcel.com/forum/excel-questions/691520-sql-via-visual-basic-applications-error-operation-not-allowed-when-object-closed.html to page: Results 1 to 10 of 26 1Likes Top All SQL http://visualbasic.ittoolbox.com/groups/technical-functional/visualbasic-l/run-time-error-3704-operation-not-allowed-when-object-is-closed-2714698 via VBA error: Operation is not allowed when the object is closedThis is a discussion on SQL via VBA error: Operation is not allowed when the object is closed within the Excel Questions forums, part of the Question Forums category; Hello, I've been trying to connect to not allowed a SQL Server database, but consistently get an "error 3704: Operation is not ... LinkBack LinkBack URL About LinkBacks Bookmark & Share Digg this Thread!Add Thread to del.icio.usBookmark in TechnoratiTweet this thread Thread Tools Show Printable Version Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Mar 14th, 2013,08:04 PM #1 Viceroy369 New Member Join Date not allowed when Jan 2013 Posts 25 SQL via VBA error: Operation is not allowed when the object is closed Hello, I've been trying to connect to a SQL Server database, but consistently get an "error 3704: Operation is not allowed when the object is closed" on this line: ws1.Range("A14").CopyFromRecordset rs The SQL query itself runs fine when I paste it into the query window of the SQL Server, so I don't think it's that. Also, I have some code to check if the recordset is empty, and it is not empty. Since I open the recordset just before I copy it, not sure why it's saying the RS is closed. Here is my complete code: Dim cn As ADODB.Connection Dim Server_Name As String Dim Database_Name As String Dim User_ID As String Dim Password As String Dim SQLStr As String Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset Dim strConn As String Dim objMyCmd As ADODB.Command Set objMyCmd = New ADODB.Command Server_Name = Range("B1").Value Database_Name = Range("B2").Value User_ID = Range("B3").Value Password = Range("B4").Value Set cn = New