Error in webclass - Please Help 
Author Message
 Error in webclass - Please Help

Hi,

I am trying to migrate and asp script that i use for searching into a VB 6.0
App, but everytime i run the script i get an error "run time error '3709'
The connection cannot be used to perform this operation it is either closed
or invalid in this context" Does anyone know what i have done wrong, i have
tried several ways but have had no luck. Could somone help me fix this code.

Thanks in advance for your answer

Sean

' code snippet----------------------------------------------

Option Explicit
Option Compare Text

Dim rsAcro As New ADODB.Recordset
Dim strProvider As New ADODB.Connection
Dim strQuery As String

Private Sub connect(objconn As ADODB.Connection)
objconn.Provider = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("\DB") & "\test.mdb;"
objconn.Open strQuery, objconn, , , adCmdText
End Sub

Private Sub Default_frmSearch()
Dim str As String

str = Request.Form("fldSearch")

strQuery = "SELECT katiref, support_contact FROM breaches WHERE katiref LIKE
'%" & str & "%'"
rsAcro.Open strQuery, strProvider, , , adCmdText

     If Not rsAcro.EOF Then
       Do Until rsAcro.EOF
         With Response
            .Write "<td><%= rsAcro(katiref)%></td>"
            .Write "<td><%= rsAcro(support_contact)%></td></tr>"
         End With
        rsAcro.MoveNext
        Loop
     End If
End Sub

Private Sub Default_Respond()
Default.WriteTemplate DEF_TMPLT
End Sub

Private Sub WebClass_Start()
Set NextItem = Default
End Sub



Sat, 12 Jul 2003 10:33:01 GMT  
 Error in webclass - Please Help
Hi,
Try this way:
...
    response.write "<td>" & recordset(whateverfeild) & "</td>
No need to use <% ... i suppose.

--
Abdul from Sydney-Australia

Quote:

> Hi,

> I am trying to migrate and asp script that i use for searching into a VB
6.0
> App, but everytime i run the script i get an error "run time error '3709'
> The connection cannot be used to perform this operation it is either
closed
> or invalid in this context" Does anyone know what i have done wrong, i
have
> tried several ways but have had no luck. Could somone help me fix this
code.

> Thanks in advance for your answer

> Sean

> ' code snippet----------------------------------------------

> Option Explicit
> Option Compare Text

> Dim rsAcro As New ADODB.Recordset
> Dim strProvider As New ADODB.Connection
> Dim strQuery As String

> Private Sub connect(objconn As ADODB.Connection)
> objconn.Provider = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
> Server.MapPath("\DB") & "\test.mdb;"
> objconn.Open strQuery, objconn, , , adCmdText
> End Sub

> Private Sub Default_frmSearch()
> Dim str As String

> str = Request.Form("fldSearch")

> strQuery = "SELECT katiref, support_contact FROM breaches WHERE katiref
LIKE
> '%" & str & "%'"
> rsAcro.Open strQuery, strProvider, , , adCmdText

>      If Not rsAcro.EOF Then
>        Do Until rsAcro.EOF
>          With Response
>             .Write "<td><%= rsAcro(katiref)%></td>"
>             .Write "<td><%= rsAcro(support_contact)%></td></tr>"
>          End With
>         rsAcro.MoveNext
>         Loop
>      End If
> End Sub

> Private Sub Default_Respond()
> Default.WriteTemplate DEF_TMPLT
> End Sub

> Private Sub WebClass_Start()
> Set NextItem = Default
> End Sub



Sat, 12 Jul 2003 21:22:45 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Please help with webclass error

2. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

3. Generating an excel file with webclass not working Please Help

4. Help with WebClass, please!

5. Webclass problem or bug, please help?

6. Help! 0x80004005 Error installing webclass

7. WebClass Runtime error '800a801d' - HELP

8. Help! 0x80004005 Error installing webclass

9. Can anyone HELP me PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE

10. PLEASE HELP PLEASE HELP PLEASE HELP

11. Error occurred while registering ocx - please, please help.

12. PLEASE PLEASE HELP - DISK MISSING FROM DRIVE A: ERROR

 

 
Powered by phpBB® Forum Software