Visual Basic.NET - CREAR UN REPORTE CON ODBC Y ACCESS

 
Vista:

CREAR UN REPORTE CON ODBC Y ACCESS

Publicado por JUAN (2 intervenciones) el 23/10/2015 18:16:00
QUE TAL ME PODRIAN AYUDAR A RESOLVER MI PROBLEMA, TENGO UNA BASE DE DATOS LLAMADA "PREPA" Y EN ELLA DOS TABLAS UNA LLAMADA "ALUMNOS Y LA OTRA DOCENTES", TENGO UN REPORTE LLAMADO CICLO.

CUANDO HAGO EL REPORTE ME SALE ESTE ERROR "El motor de base de datos de Microsoft Access no puede encontrar la tabla o consulta de entrada 'Ciclo'. Asegúrese de que existe y de que el nombre está escrito correctamente."

ME PODRIAN AYUDAR XFAS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
conexion.ConnectionString = ("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & "C:\JAGS\PREPA.accdb")
conexion.Open()
Dim valor As String
valor = frmRvarios.txtCiclo.Text
Dim comando As New OleDbCommand("select *  from Alumnos where CIngreso='" & valor & "'", conexion)
Lector = comando.ExecuteReader()
Dim contar As Integer
Try
	While Lector.Read
		contar = contar + 1
	End While
	If contar = 0 Or valor = "" Then
		MsgBox("EL ALUMNO NO EXISTE")
		Lector.Close()
	Else
		Dim cmd As New OleDbCommand("Alumnos", conexion)
		cmd.CommandType = CommandType.StoredProcedure
		Dim adaptador As New OleDbDataAdapter()
 
		adaptador.SelectCommand = New OleDbCommand
		adaptador.SelectCommand.Connection = conexion
		adaptador.SelectCommand.CommandText = "Ciclo"
		adaptador.SelectCommand.CommandType = CommandType.StoredProcedure
		Dim param1 = New OleDbParameter("@CIngreso", OleDbType.Char)
		param1.Direction = ParameterDirection.Input
		param1.Value = valor
		adaptador.SelectCommand.Parameters.Add(param1)
		Dim dataset As New DataSet
		adaptador.Fill(dataset)
		dataset.DataSetName = "DataSet1"
		Dim datasource As New ReportDataSource("DataSet1", dataset.Tables(0))
		datasource.Name = "DataSet1"
		datasource.Value = dataset.Tables(0)
		Dim ini As New ReportParameter("CIngreso", valor)
		Me.ReportViewer1.LocalReport.DataSources.Clear()
		Me.ReportViewer1.LocalReport.DataSources.Add(datasource)
		Me.ReportViewer1.LocalReport.ReportPath = ("C:\JAGS\Ciclo.rdlc")
		Me.ReportViewer1.RefreshReport()
	End If
 
	Catch ex As Exception
 
	End Try
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de giancarlo
Val: 377
Bronce
Ha mantenido su posición en Visual Basic.NET (en relación al último mes)
Gráfica de Visual Basic.NET

CREAR UN REPORTE CON ODBC Y ACCESS

Publicado por giancarlo (488 intervenciones) el 23/10/2015 21:54:24
me parece que la respuesta es obvia, no tienes la tabla ciclo, que tu reporte se llame de esa manera no significa que tu tabla sea igual. intenta crear la tabla ciclo o haz un query a las tablas que tienes
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

CREAR UN REPORTE CON ODBC Y ACCESS

Publicado por jags (2 intervenciones) el 25/10/2015 21:34:59
Me podrías decir como lo hago xfas
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar