Foros del Web » Programación para mayores de 30 ;) » .NET »

En xp anda y en 98 tira error

Estas en el tema de En xp anda y en 98 tira error en el foro de .NET en Foros del Web. Hola tengo este codigo que em crea un html a partir de una base de datos access: Código: Private Sub lclickb(ByVal sender As Object, ByVal ...
  #1 (permalink)  
Antiguo 05/05/2005, 14:23
 
Fecha de Ingreso: junio-2002
Mensajes: 212
Antigüedad: 21 años, 10 meses
Puntos: 0
En xp anda y en 98 tira error

Hola tengo este codigo que em crea un html a partir de una base de datos access:

Código:
Private Sub lclickb(ByVal sender As Object, ByVal e As EventArgs) '' handles Button1.click, button2.click
        On Error GoTo errores
        galeria = False
        Const PAGE_SIZE = 10
        Panel9.Visible = False
        Panel7.Visible = False
        Panel6.Visible = True
        If MasterConn2.State = 1 Then
            MasterConn2.Close()
        End If
        If fotoConn.State = 1 Then
            fotoConn.Close()
        End If
        If audioConn.State = 1 Then
            audioConn.Close()
        End If
        If videoConn.State = 1 Then
            videoConn.Close()
        End If
        TextBox4.Text = "Buscar"
        ComboBox2.SelectedIndex = 0
        buscar = False
        Panel7.Visible = False
        viendo = False
        ComboBox1.Enabled = True
        Dim l As cControls.cButton = CType(sender, cControls.cButton)
        botonnombre = l.Text
        pagina = 1
        FileOpen(1, Application.StartupPath & "\nav.tmp", OpenMode.Output)
        Print(1, "<html>" & vbCrLf)
        Print(1, "<head>" & vbCrLf)
        Print(1, "<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>" & vbCrLf)
        Print(1, "</head>" & vbCrLf)
        Print(1, "<body bgcolor='f9f9f9' text='#000000'>" & vbCrLf)
        Print(1, "<div align='center'><font color='#CC0000' size='4'><b>" & l.Text)
        Print(1, "</b></font></div>" & vbCrLf)
        botonid = l.Tag
        MasterConn.ConnectionString = MasterAccessConnect
        MasterConn.Open(MasterAccessConnect)
        MasterRs = New ADODB.Recordset
        MasterRs.Open("SELECT * FROM noticias where idcategoria=" & l.Tag, MasterConn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)
        Dim totalrs As Integer
        totalrs = MasterRs.RecordCount
        MasterConn.Close()
        MasterConn.ConnectionString = MasterAccessConnect
        MasterConn.Open(MasterAccessConnect)
        MasterRs = New ADODB.Recordset
        MasterRs.LockType = ADODB.LockTypeEnum.adLockOptimistic
        MasterRs.CursorLocation = ADODB.CursorLocationEnum.adUseClient

        MasterRs.Open("SELECT * FROM noticias where idcategoria=" & l.Tag & " order by fecha desc", MasterConn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)
        totalpaginas = MasterRs.PageCount
        ''   ComboBox1.Text = 1
        ComboBox1.Items.Clear()
        Dim xx As Int16
        For xx = 1 To totalpaginas

            ComboBox1.Items.Add(xx)
        Next xx

        If totalpaginas > 0 Then
            ComboBox1.SelectedIndex = pagina - 1
        Else
            ComboBox1.Items.Add("1")
            ComboBox1.SelectedIndex = 0
            GoTo sinresultados
        End If
        MasterRs.AbsolutePage = pagina
        Dim i As Integer
        i = 0
        ''MasterRs.AbsolutePage = 
        Do Until MasterRs.EOF Or MasterRs.BOF Or i = PAGE_SIZE
            i = i + 1
            ''      MsgBox(MasterRs.Fields.Item("titulo").Value)
            Print(1, "<table width='100%' border='0'>" & vbCrLf)
            Print(1, "<tr> " & vbCrLf)
            Print(1, "<td><b><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>" & MasterRs.Fields.Item("titulo").Value & vbCrLf)
            Print(1, "</font></b>" & vbCrLf)
            fotoConn.ConnectionString = fotoAccessConnect
            fotoConn.Open(fotoAccessConnect)
            fotoRs = New ADODB.Recordset
            fotoRs.Open("SELECT * FROM fotos where idnoticia='" & MasterRs.Fields.Item("idnoticia").Value & "'", fotoConn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)
            If fotoRs.RecordCount > 0 Then
                Print(1, "&nbsp;&nbsp;<img src='foto16.gif' width='16' height='16' border='0' alt='Noticia Contiene Fotos'>" & vbCrLf)
            End If
            fotoConn.Close()
            If audioConn.State = 1 Then
                audioConn.Close()
            End If
            audioConn.ConnectionString = audioAccessConnect
            audioConn.Open(audioAccessConnect)
            audioRs = New ADODB.Recordset
            audioRs.Open("SELECT * FROM audio where idnoticia='" & MasterRs.Fields.Item("idnoticia").Value & "'", audioConn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)
            If audioRs.RecordCount > 0 Then
                Print(1, "<img src='audio16.gif' width='16' height='16' border='0' alt='Noticia Contiene Audio'> " & vbCrLf)
            End If
            audioRs.Close()
            If videoConn.State = 1 Then
                videoConn.Close()
            End If
            videoConn.ConnectionString = videoAccessConnect
            videoConn.Open(videoAccessConnect)
            videoRs = New ADODB.Recordset
            videoRs.Open("SELECT * FROM video where idnoticia='" & MasterRs.Fields.Item("idnoticia").Value & "'", videoConn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)
            If videoRs.RecordCount > 0 Then
                Print(1, "<img src='video16.gif' width='16' height='16' border='0' alt='Noticia Contiene Video'>" & vbCrLf)
            End If
            videoConn.Close()
            Print(1, "</td></tr>" & vbCrLf)
            Print(1, "<tr> " & vbCrLf)
            Print(1, "<td><font face='Arial, Helvetica, sans-serif' size='1'>(" & Format(MasterRs.Fields.Item("fecha").Value, "dd MMMM yyyy") & ")" & vbCrLf)
            Print(1, "</font></td>" & vbCrLf)
            Print(1, "</tr>" & vbCrLf)
            Print(1, "<tr> " & vbCrLf)
            Print(1, "<td><font face='Verdana, Arial, Helvetica, sans-serif' size='1'>" & MasterRs.Fields.Item("copete").Value & vbCrLf)
            Print(1, "</font><br><a href='" & MasterRs.Fields.Item("idnoticia").Value & "'><img src='leer.gif' border='0'></a> </td>" & vbCrLf)

            Print(1, "</tr>" & vbCrLf)
            Print(1, "</table>" & vbCrLf)
            Print(1, "<hr>" & vbCrLf)

            MasterRs.MoveNext()
        Loop

        Print(1, " </body>" & vbCrLf)
        Print(1, "</html>" & vbCrLf)
        FileClose(1)
        wb.Navigate(Application.StartupPath & "\nav.tmp")
        ''    MsgBox(i)
        Label6.Text = "Página: " & pagina & " de " & totalpaginas
        '' MsgBox(MasterRs.)
        MasterConn.Close()

        Panel6.Visible = True
        Exit Sub
sinresultados:
        MasterConn.Close()
        ComboBox1.Enabled = False
        Print(1, "<table width='100%' border='0'>" & vbCrLf)
        Print(1, "<tr> " & vbCrLf)
        Print(1, "<td><b><br><div align='center'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>¡No hay ninguna noticia ingresada en esta sección!" & vbCrLf)
        Print(1, "</font></div></b></td>" & vbCrLf)
        Print(1, "</tr>" & vbCrLf)
        Print(1, "</table>" & vbCrLf)
        Print(1, " </body>" & vbCrLf)
        Print(1, "</html>" & vbCrLf)
        FileClose(1)
        wb.Navigate(Application.StartupPath & "\nav.tmp")
        ''    MsgBox(i)
        Label6.Text = "Página: 1 de 1" ''& totalpaginas

        Panel6.Visible = True
        Exit Sub
errores:
        Panel6.Visible = True
        If MasterConn2.State = 1 Then
            MasterConn2.Close()
        End If
        If MasterConn.State = 1 Then
            MasterConn.Close()
        End If
        If fotoConn.State = 1 Then
            fotoConn.Close()
        End If
        If audioConn.State = 1 Then
            audioConn.Close()
        End If
        If videoConn.State = 1 Then
            videoConn.Close()
        End If
        FileClose(1)
        ''  Return
        MsgBox(Err.Description)
        Err.Clear()
    End Sub
El tema es que en xp este codigo anda barbaro pero en 98 con la misma base de datos MDAC 2.8 instalado y el mismo ejecutable me dice que o se borro el registro o EOF=true pero en XP nada, me muestra todo barbaro...
Alguien me peude explicar que sucede y como lo arreglo? porque la verdad se me acabaron las maldiciones permitidas para 1 solo programa :D
Gracias
__________________
Simuladores y Examenes Cisco, Herramientas de Red Online - Tecnologia y Redes
  #2 (permalink)  
Antiguo 05/05/2005, 14:47
Avatar de RootK
Moderador
 
Fecha de Ingreso: febrero-2002
Ubicación: México D.F
Mensajes: 8.004
Antigüedad: 22 años, 2 meses
Puntos: 50
MMM.. antes que otra cosa.. lo que no entiendo es porque usas sintaxis de la version de vb anterior..??

Porque sigues usando ADO, on error goto, etc.. ??

Porque si estas usando vb.net sigues haciendolo de la forma antigua ?

Salu2
__________________
Nadie roba nada ya que en la vida todo se paga . . .

Exentrit - Soluciones SharePoint & Net
  #3 (permalink)  
Antiguo 05/05/2005, 14:52
 
Fecha de Ingreso: junio-2002
Mensajes: 212
Antigüedad: 21 años, 10 meses
Puntos: 0
POrque es la forma mas rapida, simple y manual que me permite tener control total sobre los datos sin la encesidad de utilizar componentes del framework.
Pero es basicamente cuestion de gustos, hay gente que usea datagrid apra todo, yo jamas utilizaria ese control que me limita en la edicion, crearia mi propio control, pero aca el tema es simple, en xp/2000 la aplicacion funciona a las 1000 maravillas pero con la misma base y archivos en 9x me dice que eof=true, o sea, es como que sobrepaso el final del archivo y no entiendo porque.... ingluso cuando el saco en on error me sigue mostrando el error como si lo hubiera utilizado... la verdad es que ya no entiendo nada...
Abrazo
__________________
Simuladores y Examenes Cisco, Herramientas de Red Online - Tecnologia y Redes
  #4 (permalink)  
Antiguo 05/05/2005, 21:50
 
Fecha de Ingreso: junio-2002
Mensajes: 212
Antigüedad: 21 años, 10 meses
Puntos: 0
Bueh, ya esta, lo solucione, gracias pro la ayuda.
__________________
Simuladores y Examenes Cisco, Herramientas de Red Online - Tecnologia y Redes
  #5 (permalink)  
Antiguo 06/05/2005, 07:44
Avatar de RootK
Moderador
 
Fecha de Ingreso: febrero-2002
Ubicación: México D.F
Mensajes: 8.004
Antigüedad: 22 años, 2 meses
Puntos: 50
Cita:
Bueh, ya esta, lo solucione, gracias pro la ayuda.
Buen

Aunque también sería bueno que compartieras lo que hiciste.
  #6 (permalink)  
Antiguo 08/05/2005, 23:54
 
Fecha de Ingreso: junio-2002
Mensajes: 212
Antigüedad: 21 años, 10 meses
Puntos: 0
El problema se daba dentro del evento beforenavigate del webbrowser control, al pareces win9x trabaja las url en mayusculas mientras que windows nt trabaja con minusculas, teniendo rutinas en casi todos los enventos no estaba claro donde se daba el error...
Concejo a todo el mundo haganse un trapeo universal de errores no trapeen por evento porque despues no saben de donde viene el despelote.
__________________
Simuladores y Examenes Cisco, Herramientas de Red Online - Tecnologia y Redes
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:12.