Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/03/2010, 09:51
mcofy
 
Fecha de Ingreso: marzo-2008
Mensajes: 60
Antigüedad: 16 años, 1 mes
Puntos: 1
Respuesta: Accees con crystal report

Bueno he resuelto el problema, y era mas simple de lo que pensaba, lo unico que realice fue usar el mismo codigo que uso para el mysql, y lo adapte al una conexion con accees y funciona de maravilla. Les conparto el codigo:


Código vb:
Ver original
  1. Const DB_PATH = "\\direccion_ip\base.MDB"
  2.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  3.         Dim con2 As New OleDbConnection
  4.         con2.ConnectionString = "PROVIDER=MICROSOFT.JET.OLEDB.4.0; " & "DATA SOURCE=" & DB_PATH
  5.         con2.Open()
  6.         'MsgBox("open")
  7.        Dim ds2 As New DataSet
  8.         Dim da2 As New OleDbDataAdapter
  9.         Dim dt2 As New DataTable
  10.         Dim comando2 As New OleDbCommand
  11.         Dim consulta As String
  12.         consulta = "select * from tabla where folio= '" & Me.TextBox1.Text & "'"
  13.         Dim reporte2 As New reporte_patologia
  14.         dt2.Clear()
  15.         comando2.Connection = con2
  16.         comando2.CommandText = consulta
  17.         da2 = New OleDbDataAdapter(comando2)
  18.         da2.Fill(dt2)
  19.         reporte2.SetDataSource(dt2)
  20.         reporte2.Refresh()
  21.         Me.CrystalReportViewer1.ReportSource = reporte2
  22.         Me.CrystalReportViewer1.Refresh()
  23.         con2.Close()
  24.         con2.Dispose()
  25.     End Sub

Bueno saludos y gracias!