|
-
Jun 25th, 2003, 01:22 PM
#1
Thread Starter
Fanatic Member
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:
Private Sub cmdSTP2Next_Click()
On Error GoTo Err_handler
Screen.MousePointer = vbHourglass
Call CreateConnection(objConn)
Set objRs = New ADODB.Recordset
objRs.ActiveConnection = objConn
objRs.CursorLocation = adUseClient
objRs.CursorType = adOpenDynamic
objRs.LockType = adLockOptimistic
objRs.Source = "select * from CAMPAIGNDETAILS where cd_id = '" & frmIntro.txtGlobalID.Text & "' and table_id_number = '" & lstBio2.ItemData(iCount) & "'"
MsgBox objRs.Source
objRs.Open
'this checks to see if the records exist if it does don't add it
With objRs
If objRs.EOF Then
For iCount = 0 To lstBio2.ListCount - 1
sSQL = "INSERT INTO CAMPAIGNDETAILS(cd_id, cd_type, table_id_number) Values ('" & frmIntro.txtGlobalID.Text & "',('BIO')," & lstBio2.ItemData(iCount) & ")"
objConn.Execute (sSQL)
'MsgBox lstBio2.ItemData(iCount)
Next iCount
End If
'Debug.Print Error
End With
Set objRs = Nothing
Call CloseConnection(objConn)
Call closeAllFrames
'------------------ determin which frame to load based on chekkbox value ---------
If frmIntro.txtTest.Text = 1 Then
Call LoadTestimonials
ElseIf frmIntro.txtAud.Text = 1 Then
Call LoadAudience
ElseIf frmIntro.txtPort.Text = 1 Then
Call LoadPortfolios
ElseIf frmIntro.txtPR.Text = 1 Then
Call LoadPressReleases
ElseIf frmIntro.txtNews.Text = 1 Then
Call LoadNewsArticles
Else
frmIntro.fraContactInfo.Visible = True
End If
Screen.MousePointer = vbDefault
Err_handler:
If Err.Number <> 0 Then
errLogger Err.Number, Err.Description, "SetDetails"
Err.Clear
Resume Next
End If
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|