Results 1 to 40 of 40

Thread: need help *RESOLVED*

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Navarone's Avatar
    Join Date
    Jun 2003
    Location
    Akron, Ohio USA
    Posts
    740

    Talking need help *RESOLVED*

    I keep getting an error in my code. So I founf some code to handle the error an write it to log file. It errors out on my Select statement in the attahced code.

    Error Log:

    381,"Invalid property array index","SetDetails",#2003-06-25 14:13:21#
    -2147217908,"Command text was not set for the command object.","SetDetails",#2003-06-25 14:13:23#
    3704,"Operation is not allowed when the object is closed.","SetDetails",#2003-06-25 14:13:23#


    VB Code:
    1. Private Sub cmdSTP2Next_Click()
    2.  
    3.  On Error GoTo Err_handler
    4.  
    5. Screen.MousePointer = vbHourglass
    6.     Call CreateConnection(objConn)
    7.     Set objRs = New ADODB.Recordset
    8.  
    9.         objRs.ActiveConnection = objConn
    10.         objRs.CursorLocation = adUseClient
    11.         objRs.CursorType = adOpenDynamic
    12.         objRs.LockType = adLockOptimistic
    13.         objRs.Source = "select * from CAMPAIGNDETAILS where cd_id = '" & frmIntro.txtGlobalID.Text & "' and table_id_number = '" & lstBio2.ItemData(iCount) & "'"
    14.         MsgBox objRs.Source
    15.         objRs.Open
    16.  
    17.         'this checks to see if the records exist if it does don't add it
    18.        With objRs
    19.             If objRs.EOF Then
    20.                 For iCount = 0 To lstBio2.ListCount - 1
    21.                     sSQL = "INSERT INTO CAMPAIGNDETAILS(cd_id, cd_type, table_id_number) Values ('" & frmIntro.txtGlobalID.Text & "',('BIO')," & lstBio2.ItemData(iCount) & ")"
    22.                     objConn.Execute (sSQL)
    23.                     'MsgBox lstBio2.ItemData(iCount)
    24.                 Next iCount
    25.             End If
    26.                 'Debug.Print Error
    27.        End With
    28.  
    29.         Set objRs = Nothing
    30.     Call CloseConnection(objConn)
    31.  
    32.   Call closeAllFrames
    33.        
    34. '------------------ determin which frame to load based on chekkbox value ---------
    35.     If frmIntro.txtTest.Text = 1 Then
    36.         Call LoadTestimonials
    37.     ElseIf frmIntro.txtAud.Text = 1 Then
    38.         Call LoadAudience
    39.     ElseIf frmIntro.txtPort.Text = 1 Then
    40.         Call LoadPortfolios
    41.     ElseIf frmIntro.txtPR.Text = 1 Then
    42.         Call LoadPressReleases
    43.     ElseIf frmIntro.txtNews.Text = 1 Then
    44.         Call LoadNewsArticles
    45.     Else
    46.         frmIntro.fraContactInfo.Visible = True
    47.     End If
    48.    
    49. Screen.MousePointer = vbDefault
    50.  
    51. Err_handler:
    52.    If Err.Number <> 0 Then
    53.       errLogger Err.Number, Err.Description, "SetDetails"
    54.       Err.Clear
    55.        
    56.       Resume Next
    57.      
    58.     End If
    59. End Sub
    Last edited by Navarone; Jun 26th, 2003 at 02:45 PM.
    He who never made a mistake never made a discovery?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width