[AccessD] Recordset method Failed
    David Emerson 
    newsgrps at dalyn.co.nz
       
    Thu Sep  7 22:58:20 CDT 2017
    
    
  
Hi Jim,
Yes and records are being returned.  The IT guy is building a new clean
server to see if that will solve the problem.
Regards
David
-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim
Lawrence
Sent: Friday, 8 September 2017 2:55 p.m.
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Recordset method Failed
Did you check for any return errors or check to see if any records were
returned?
Jim
----- Original Message -----
From: "David Emerson" <newsgrps at dalyn.co.nz>
To: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
Sent: Wednesday, September 6, 2017 3:19:37 PM
Subject: [AccessD] Recordset method Failed
Hi Listers,
 
I have an accdb which uses ADO to get a recordset from an SQL Server
database
 
I am getting the following error:
 
Run-time error '-2147024770 (8007007e)' 
Method 'Recordset' of object '_Combobox' failed.
 
The code is:
 
    Set rstTemp = basRunDataObject("dbo.spfrmAAMenu", adCmdText)   <--- This
function code is given at the end of this message
 
' If Not rstTemp.EOF Then
'     rstTemp.MoveFirst
'     Do Until rstTemp.EOF
'         MsgBox rstTemp!LGARegionID
'         rstTemp.MoveNext
'     Loop
'End If
 
    Set Me!cboFilterLGARegionIDNo.Recordset = rstTemp    <--- Error on this
line
 
 
When I unrem the code block then the msgbox shows the values of the
LGARegionID which indicates that the recordset is being returned.
 
Here is the rub.  The programme is working fine on my machine and on the
clients current machine.  It is only on their new server that they are
wanting to migrate to that the problem happens.
 
Also, it is happening for all similar calls to set combobox recordsets and
form recordsets throughout the whole programme.
Also, it was working a few days ago, but when they tried yesterday it
stopped working.
 
The only area I can think of is some permissions at the SQL Server database
end.  The IT department was playing with security settings.  Could one of
these caused the problem?
 
 
Public Function basRunDataObject(strCommandText As String, commandType As
ADODB.CommandTypeEnum) As ADODB.Recordset
 
    On Error GoTo Err_basRunDataObject
 
    Dim adocmd As ADODB.Command
    Dim rst As ADODB.Recordset
    Set rst = New ADODB.Recordset
 
    rst.LockType = adLockOptimistic
    rst.CursorType = adOpenKeyset
    rst.CursorLocation = adUseClient
 
    If gADODBConnection.State = adStateClosed Then
        Call basOpenGlobalConnection
    End If
 
    Set adocmd = New ADODB.Command
    With adocmd
        .ActiveConnection = gADODBConnection
        .CommandText = strCommandText
        .commandType = commandType
        .CommandTimeout = 0
    End With
    
    rst.Open adocmd
    
    Set basRunDataObject = rst
    Set adocmd = Nothing
 
Exit_basRunDataObject:
    Exit Function
 
Err_basRunDataObject:
    Select Case Err
        Case 0:
        Case Else
            Call basErrorMsg("basRunDataObject - " & strCommandText)
    End Select
    Resume Exit_basRunDataObject
    Exit Function
 
End Function
 
 
Regards
David Emerson
Dalyn Software Ltd
Wellington, New Zealand
 
 
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
    
    
More information about the AccessD
mailing list