Error 482, error de impresora. Vb6

Deje esta pregunta en un foro pero no me contestaron, a ver si tu pudieras ayudarme, he instalado el spk6 de vb6 y ni así funciona. Te describo el problema.
Mil gracias por adelantado
Tengo el siguiente problema. Imprimiendo unos campos de una base de datos me da el siguiente error.
Error 482 en tiempo de ejecución. Error de impresora.
En el código puse un retardo, por si era problema de que mandaba muchas cosas, pero lo mismo me da cuando imprime el cuarto registro, que a veces en el 20. Os dejo el código para que lo veáis.
Private Sub Imprimir_Click()
Dim datos As Database
Dim tablaa As Recordset
Dim tablab As Recordset
Dim tablac As Recordset
Dim tablad As Recordset
Dim j, nombre As String
Dim i, k, m, l, temp As Integer
Dim conta As Double
Dim z, encontrado, codigo, cod_t, x, y As Integer
Dim n As Printer
Dim nombre2, dire, ciudad As String
Dim tiendas As Integer
tiendas = 0
'datos abre la base de datos control stock
'tabla abrira la tabla que queramos
Set datos = OpenDatabase("c:\archivos de programa\stock\controlstock.mdb")
Set tablaa = datos.OpenRecordset("pedido", dbOpenTable)
Set tablab = datos.OpenRecordset("linea_pedido", dbOpenTable)
Set tablac = datos.OpenRecordset("tiendas", dbOpenTable)
Set tablad = datos.OpenRecordset("tiendas", dbOpenTable)
tablac.MoveFirst
i = 1
'busco el nombre
While i <> 0
Text2.Text = ""
Text2.Text = tablac.Fields("cod_tienda")
temp = 0
temp = tablac.Fields("cod_tienda")
nombre = ""
nombre = "T"
nombre = nombre + Text2.Text
If Me.Controls(nombre).Value = 1 Then
tienda = tienda + 1
' ahora imprimo
x = 100
y = 50
j = 0
tablad.MoveFirst
z = 0
While z = 0
If temp <> tablad.Fields("cod_tienda") Then
tablad.MoveNext
Else
z = 1
End If
Wend
' For Each n In Printers
' j = j + 1
' Next
' If j = 0 Then
' MsgBox "error no se encuentra impresora"
' Else
nombre2 = ""
dire = ""
ciudad = ""
nombre2 = tablad.Fields("nombre")
dire = tablad.Fields("direccion")
ciudad = tablad.Fields("cp")
ciudad = ciudad + " "
ciudad = ciudad + tablad.Fields("cidudad")
Printer.TrackDefault = True
Printer.ScaleMode = 6
Printer.ScaleWidth = 2970
Printer.ScaleHeight = 2100
Printer.Orientation = 2
Printer.FontSize = 20
Printer.CurrentX = 100
Printer.CurrentY = 50
Printer.Print "Confecciones Mayoral"
Printer.CurrentX = 100
Printer.CurrentY = 125
Printer.Print "C/La Orotava 118"
Printer.CurrentX = x
Printer.CurrentY = 200
Printer.Print "Polkgono Industrial San Luis"
Printer.CurrentX = 100
Printer.CurrentY = 275
Printer.Print "29006 Milaga"
Printer.FontSize = 28
Printer.CurrentX = 1600
Printer.CurrentY = 600
Printer.Print nombre2
Printer.CurrentX = 1600
Printer.CurrentY = 700
Printer.Print dire
Printer.CurrentX = 1600
Printer.CurrentY = 800
Printer.Print ciudad
Printer.NewPage
Me.Controls(nombre).Value = 0
' End If
End If ' fin si de los controles
l = 0
While l <> 30
conta = 0
While conta <> 65000
conta = conta + 1
Wend
l = l + 1
Wend
tablac.MoveNext
If tablac.EOF Then i = 0
Wend
MsgBox "se han impreso las tiendas"
MsgBox tienda
Printer.EndDoc
End Sub

1 Respuesta

Respuesta
1
Aquí esta la solución del propio Microsoft
http://support.microsoft.com/kb/242483/es
probd lo del service pack y eso no va, asi que me queda imprimir con la api. Perdona pero soy novato, podrias decirme como va el otro metodo?
Lo siento pero yo no tengo instalado el vb6, aplícalo y si tienes problemas me dices y tienes problemas me avisas y con mucho gusto te ayudo si puedo.
Pues instale el service pack 6 y nada. He probado mil cosas y efectivamente me tengo que olvidad el printer.print.
He estado buscando lo de la api y como usarla, pero no encuentro información. ¿Me podrías ayudar?
¿Cómo estas buscando?

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas