Hola!

Deseo crear un archivo a partir de un campo general de DBF libre de Fox. Que contiene información variada de varios tipos de servidores COM.
Ya guardo los datos en el archivo.
El problema es que al guardar los datos guarda también información que proviene del Ole COM de Fox. Como no es una estructura estática no sé como quitarlo y por supuesto al intentar abrir el archivo el software COM no encuentra estructura compatible y no lo abre.
Dim oConn_ofr_dbj
Dim O_Campo
Dim Objeto
Dim Objeto_Size
Dim Cadena_Coneccion
Dim lArchivo
Dim n
Dim Prueba
Set oConn_ofr_dbj = Server.CreateObject("ADODB.Connection")
'oConn_ofr_dbj.Open("Driver=VFPODBC.DLL;DSN=Visual FoxPro Tables;UID=;PWD=;SourceDB=d:\Estudio_Ofertas\C\Sistema_Estudio_2005\ODBC\Ofertas_Estudio\000011;SourceType=DBF;Exclusive=No;BackgroundFetch=Sí;Collate=Machine")
Cadena_Coneccion = "Provider=MSDASQL.1;Persist Security Info=False;Extended Properties=DSN=Adjuntos;UID=;SourceDB=\\Wsobrrdiaztor\C\Sistema_Estudio_2005\ODBC\Ofertas_Estudio\" & Directorio &";SourceType=DBF;Exclusive=No;BackgroundFetch=Sí;Collate=Machine;"
oConn_ofr_dbj.Open( Cadena_Coneccion)
Set O_Campo = oConn_ofr_dbj.Execute( "Select Doc_Adj, Archivo From ofr_dbj")
Objeto_Size = O_Campo( "Doc_Adj").ActualSize
Objeto = O_Campo( "Doc_Adj").GetChunk( Objeto_Size)
lArchivo = O_Campo( "Archivo")
'Objeto = O_Campo.Fields("Doc_Adj")
Response.Write lArchivo
'************************
'Este Funciona y lo crea a modo Texto
archivo = "\\Wsobrrdiaztor\C\Sistema_Estudio_2005\Adjuntos\Basura.PDF"
set confile = createObject("scripting.filesystemobject")
set fich = confile.CreateTextFile(archivo)
fich.close()
'*********************
'Set the content type to the specific type that you are sending.
'Response.ContentType = "application"
Const adTypeBinary = 1
Dim strFilePath
strFilePath = "\\Wsobrrdiaztor\C\Sistema_Estudio_2005\Adjuntos\Basura.PDF" 'This is the path to the file on disk.
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath
'Response.BinaryWrite Objeto
adSaveCreateOverWrite = 2
'Objeto = Right( Objeto, 166)
objStream.Write Objeto
objStream.SaveToFile "\\Wsobrrdiaztor\C\Sistema_Estudio_2005\Adjuntos\Basura.PDF", adSaveCreateOverWrite
Response.BinaryWrite "<br> Archivo: "
Response.BinaryWrite Server.HTMLEncode( objStream.Type)
Response.BinaryWrite "<br> Tamaño: "
Response.BinaryWrite Server.HTMLEncode( objStream.Size)
Response.BinaryWrite "<br> State: "
Response.BinaryWrite Server.HTMLEncode( objStream.State)
Response.BinaryWrite "<br> Mode: "
Response.BinaryWrite Server.HTMLEncode( objStream.Mode)
Response.BinaryWrite "<br> Position: "
Response.BinaryWrite Server.HTMLEncode( objStream.Position)
objStream.Close
Set objStream = Nothing
'************************

1 Respuesta

Respuesta
1
Te la Respondí por teléfono!

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas