Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

Invalid Operation Reserved Error -2147217867

Discussion in 'Information Technology' started by swedbera, Jul 28, 2006.

  1. swedbera

    Expand Collapse

    I have used the following successfully in the past. I have not used it in a
    couple of months and now it hangs up on the rs.open line and I can't seem to
    figure out why. I've tried changing the code and nothing is working for me.
    I get rid of one error and get a new error. This is my original code that
    did work at one time. I'm sure that something else in the database has
    changed over the past months, but what exactly that would have caused this
    not to work, I can't figure out.

    Can someone help - please!


    Dim rs As New ADODB.Recordset
    Dim bRSOpened As Boolean
    Dim Cnn As ADODB.Connection
    Dim bCnnOpened As Boolean
    Dim msg As String, varNumber As Variant

    bRSOpened = False
    bCnnOpened = False

    If IsNull(Me.cboCurrentSupId) Or IsNull(Me.cboNewSupID) Then
    msg = "You must select a current Supervisor"
    msg = msg & " and another Supervisor you want"
    msg = msg & " to reassign Employees to."
    MsgBox msg, vbInformation, "Reassign Supervisor"
    End If

    If Me.lstEmployees.ItemsSelected.Count = 0 Then
    MsgBox "You must select as least one Employee to reassign.",
    Exit Sub
    End If

    Set Cnn = CurrentProject.Connection
    rs.Index = "PrimaryKey"
    rs.Open "tblEmployee", Cnn, adOpenStatic, adLockOptimistic,
    bRSOpened = True
    bCnnOpened = True

    'Set up the For Each loop throught the collection
    For Each varNumber In Me.lstEmployees.ItemsSelected
    rs.Seek Me.lstEmployees.ItemData(varNumber), adSeekFirstEQ
    rs!SupID = Me.cboNewSupID

    Me.cboCurrentSupId = Me.cboNewSupID
    Me.cboNewSupID = Null

    stSQL = "SELECT tblEmployee.EmpID, tblEmployee.Employee,
    qlkp_Supervisors.Supervisor, qlkp_Managers.Manager FROM (tblEmployee LEFT
    JOIN qlkp_Supervisors ON tblEmployee.SupID = qlkp_Supervisors.SupId) LEFT
    JOIN qlkp_Managers ON tblEmployee.MgrID = qlkp_Managers.MgrID WHERE
    qlkp_Supervisors.supid = '" & Me.cboCurrentSupId & "' ORDER BY
    Me.lstEmployees.RowSource = stSQL


    bRSOpened = False
    bCnnOpened = False
    Set Cnn = Nothing
  2. Loading...

    Similar Threads Forum Date
    Sikh News Sikh rendered invalid in ’84 riots seeks justice (Gulf Times) Breaking News Mar 14, 2008
    Sikh News 23 years later, invalid Sikh seeks justice (Calcutta News) Breaking News Mar 13, 2008
    Sikh News 23 years later, invalid Sikh seeks justice (New Kerala) Breaking News Mar 13, 2008
    Sikh News 23 years later, invalid Sikh seeks justice (Hindustan Times) Breaking News Mar 13, 2008
    1984 Sikhs demand declassification of documents related to Operation Bluestar History of Sikhism Jun 3, 2014

Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     

Share This Page