Code:
Combo1.Text = "Select Stage"
SQL = "SELECT * FROM STAGETEMP where wfname = '" & WorkFlowName & "'"
If Temporary.TemporaryData.State = 0 Then
Temporary.TemporaryData.Open
End If
rsStageTemp = Temporary.TemporaryData.Execute(SQL, adOpenForwardOnly, adLockReadOnly)
'ERROR - OPEN/CLOSED DATABASE STUFF
'Temporary.rsStageTemp.Source = "SELECT * FROM STAGETEMP where wfname = " & WorkFlowName
'If Temporary.TemporaryData.State = 0 Then Temporary.TemporaryData.Open
'If Temporary.TemporaryData.State <> 0 Then
' Temporary.TemporaryData.Close
' End If
If Temporary.rsStageTemp.State = 0 Then
rsStageTemp = Temporary.rsStageTemp.Open(SQL, conn, adOpenForwardOnly, adLockReadOnly)
End If
'Temporary.TemporaryData.Cancel
'If (Temporary.rsStageTemp.State = 1) Then
Do While Not Temporary.rsStageTemp.EOF 'loads the various stages in
Combo1.AddItem (i & " " & Temporary.rsStageTemp.Fields("STAGENAME"))
i = i + 1
Temporary.rsStageTemp.MoveNext
Loop
'End If
Hi - I have the above code, when I get to the Do While Not loop - it says not allowed when connection is closed, yet wont allow me to open it.
As you can see from what I've commented out, I've tried opening the connection (called 'TemporaryData') the recordSet (rsStageTemp - throws another error when I do that!)
I'm a novice so I've done something (I'm sure) glaringly obvious.
Any chance someone could point it out to me? Wits end here....
Thanks!