From: | "Herberth Lagos" <hlagos(at)hylcomputacion(dot)com> |
---|---|
To: | <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Error type lo no existe |
Date: | 2007-05-08 16:31:37 |
Message-ID: | 0b3201c7918e$5c8879e0$fb532ebe@desktop |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Estimados,
Me da ese error al procesar un desde Visual Basic 6, al insertar una imagen al la base de datos:
La creación de la tabla es Así:
CREATE TABLE "public"."prueba" (
"codigo" INTEGER NOT NULL,
"texto" VARCHAR(20) NOT NULL,
"mono" BYTEA NOT NULL
) WITH OIDS;
y el codigo en Visual Basic 6:
Set Cmdo = New ADODB.Command
Cmdo.ActiveConnection = Cn
Cmdo.CommandText = "INSERT INTO public.prueba(codigo,texto,mono) VALUES (?, ?, ?)"
Cmdo.CommandType = adCmdText
fd = FreeFile
Open strimage For Binary Access Read As fd
flen = LOF(fd)
If flen = 0 Then
Close
MsgBox "Error Archivo Corrupto."
Exit Sub
End If
Set P_codigo = Cmdo.CreateParameter("P_codigo", adInteger, adParamInput, RutEmp.MaxLength)
P_codigo.Value = IIf(Len(RutEmp) = 0, Null, RutEmp.Text)
Cmdo.Parameters.Append P_codigo
Set P_texto = Cmdo.CreateParameter("P_texto", adVarChar, adParamInput, NbFant.MaxLength)
P_texto.Value = IIf(Len(NbFant) = 0, Null, NbFant)
Cmdo.Parameters.Append P_texto
Set P_mono = Cmdo.CreateParameter("P_mono", adLongVarBinary, adParamInput, flen)
ReDim chunk(1 To flen)
Get fd, , chunk()
P_mono.AppendChunk chunk()
Cmdo.Parameters.Append P_mono
Cmdo.Execute
Gracias.
Atte,
Herberth Lagos
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2007-05-08 17:09:55 | Re: Error type lo no existe |
Previous Message | Emilio Capolupo | 2007-05-08 15:59:02 | min(ctid) |