Importando desde Excel

05/06/2008 - 21:04 por Geovanny Quirós C. | Informe spam
Éste es un mensaje de varias partes en formato MIME.
=_NextPart_000_0052_01C8C70C.B5305E00

Hola grupo,
en Microsoft he conseguido el siguiente ejemplo que deberia importar desde Excel hacia Sql2005:
Trabajo con XP sp2 y Sql2005

SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',

'Excel 5.0;Database=C:\tempo\asociados50.xls', 'SELECT * FROM [hoja1$]')


Pero me da el siguiente error:

[OLE/DB provider returned message: Unspecified error]

OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005: ].

Msg 7399, Level 16, State 1, Line 1

OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.


De aqui he tomado el ejemplo: http://support.microsoft.com/kb/321686/es
Alguien me puede dar una luz?
Muchas gracias

________________

Geovanny Quirós C.
Heredia, Costa Rica

=_NextPart_000_0052_01C8C70C.B5305E00

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-1>
<META content="MSHTML 6.00.6000.16640" name=GENERATOR></HEAD>
<BODY id=MailContainerBody
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px"
bgColor=#ffffff leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Arial size=2>Hola grupo,</FONT></DIV>
<DIV><FONT face=Arial size=2>en Microsoft he conseguido el siguiente ejemplo que
deberia importar desde Excel hacia Sql2005:</FONT></DIV>
<DIV><FONT face=Arial size=2>Trabajo con XP sp2 y Sql2005 </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff size=2>
<P>SELECT</FONT><FONT size=2> </FONT><FONT color=#808080 size=2>*</FONT><FONT
size=2> </FONT><FONT color=#0000ff size=2>INTO</FONT><FONT size=2> XLImport5
</FONT><FONT color=#0000ff size=2>FROM</FONT><FONT size=2> </FONT><FONT
color=#0000ff size=2>OPENROWSET</FONT><FONT color=#808080 size=2>(</FONT><FONT
color=#ff0000 size=2>'Microsoft.Jet.OLEDB.4.0'</FONT><FONT color=#808080
size=2>,</P></FONT><FONT color=#ff0000 size=2>
<P>'Excel 5.0;Database=C:\tempo\asociados50.xls'</FONT><FONT color=#808080
size=2>,</FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2>'SELECT * FROM
[hoja1$]'</FONT><FONT color=#808080 size=2>)</P></FONT></DIV><FONT face=Arial
size=2>
<DIV>&nbsp;</DIV>
<DIV>Pero me da el siguiente error:</DIV>
<DIV>&nbsp;</DIV><FONT size=1>
<P>[OLE/DB provider returned message: Unspecified error]</P>
<P>OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'
IDBInitialize::Initialize returned 0x80004005: ].</P>
<P>Msg 7399, Level 16, State 1, Line 1</P>
<P>OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. </P></FONT>
<DIV><BR>De aqui he tomado el ejemplo: <A
href="http://support.microsoft.com/kb/321...t;>http://support.microsoft.com/kb/321686/es</A></DIV>
<DIV>Alguien me puede dar una luz?&nbsp;</DIV>
<DIV>Muchas gracias</DIV>
<DIV><BR>________________</DIV>
<DIV>&nbsp;</DIV>
<DIV>Geovanny Quirós C.<BR>Heredia, Costa Rica<BR></FONT></DIV></BODY></HTML>

=_NextPart_000_0052_01C8C70C.B5305E00--

Preguntas similare

Leer las respuestas

#11 Geovanny Quirós C.
05/06/2008 - 23:30 | Informe spam
Éste es un mensaje de varias partes en formato MIME.
=_NextPart_000_00FF_01C8C721.1C4E2270

He realizado lo siguiente:
Creé un Linked Server en el servidor sql2005 indicando el archivo fuente de excel y la version ademas de proveedor JET
y con una sola linea pude hacer la consulta

SELECT * FROM OPENQUERY(SERVIDOREXCEL, 'SELECT * FROM [HOJA1$]')

Excelente!! estoy feliz, esto me ahorrará mucho tiempo en algunas tareas diarias, gracias Gustavo.





"Geovanny Quirós C." escribió en el mensaje de noticias:

Hola grupo,
en Microsoft he conseguido el siguiente ejemplo que deberia importar desde Excel hacia Sql2005:
Trabajo con XP sp2 y Sql2005

SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',

'Excel 5.0;Database=C:\tempo\asociados50.xls', 'SELECT * FROM [hoja1$]')


Pero me da el siguiente error:

[OLE/DB provider returned message: Unspecified error]

OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005: ].

Msg 7399, Level 16, State 1, Line 1

OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.


De aqui he tomado el ejemplo: http://support.microsoft.com/kb/321686/es
Alguien me puede dar una luz?
Muchas gracias

________________

Geovanny Quirós C.
Heredia, Costa Rica

=_NextPart_000_00FF_01C8C721.1C4E2270

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-1>
<META content="MSHTML 6.00.6000.16640" name=GENERATOR></HEAD>
<BODY id=MailContainerBody
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px"
bgColor=#ffffff leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Arial size=2>He realizado lo siguiente:</FONT></DIV>
<DIV><FONT face=Arial size=2>Creé un Linked Server en el servidor sql2005
indicando el archivo fuente de excel y la version ademas de proveedor
JET</FONT></DIV>
<DIV><FONT face=Arial size=2>y con una sola linea pude hacer la
consulta</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff size=2>
<P>SELECT</FONT><FONT size=2> </FONT><FONT color=#808080 size=2>*</FONT><FONT
size=2> </FONT><FONT color=#0000ff size=2>FROM</FONT><FONT size=2> </FONT><FONT
color=#0000ff size=2>OPENQUERY</FONT><FONT color=#808080 size=2>(</FONT><FONT
size=2>SERVIDOREXCEL</FONT><FONT color=#808080 size=2>,</FONT><FONT size=2>
</FONT><FONT color=#ff0000 size=2>'SELECT * FROM [HOJA1$]'</FONT><FONT
color=#808080 size=2>)</FONT></P>
<P><FONT face=Arial size=2>Excelente!! estoy feliz,&nbsp;esto me ahorrará mucho
tiempo en algunas tareas diarias, gracias Gustavo.</FONT></P>
<P>&nbsp;</P>
<P><FONT face=Arial size=2></FONT>&nbsp;</P>
<P>"Geovanny Quirós C." &lt;<A
title="mailto:&#10;CTRL + clic para seguir el vínculo"
href="mailto:"></A>&gt;
escribió en el mensaje de
noticias:</P></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><FONT face=Arial size=2>Hola grupo,</FONT></DIV>
<DIV><FONT face=Arial size=2>en Microsoft he conseguido el siguiente ejemplo
que deberia importar desde Excel hacia Sql2005:</FONT></DIV>
<DIV><FONT face=Arial size=2>Trabajo con XP sp2 y Sql2005 </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff size=2>
<P>SELECT</FONT><FONT size=2> </FONT><FONT color=#808080 size=2>*</FONT><FONT
size=2> </FONT><FONT color=#0000ff size=2>INTO</FONT><FONT size=2> XLImport5
</FONT><FONT color=#0000ff size=2>FROM</FONT><FONT size=2> </FONT><FONT
color=#0000ff size=2>OPENROWSET</FONT><FONT color=#808080 size=2>(</FONT><FONT
color=#ff0000 size=2>'Microsoft.Jet.OLEDB.4.0'</FONT><FONT color=#808080
size=2>,</P></FONT><FONT color=#ff0000 size=2>
<P>'Excel 5.0;Database=C:\tempo\asociados50.xls'</FONT><FONT color=#808080
size=2>,</FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2>'SELECT * FROM
[hoja1$]'</FONT><FONT color=#808080 size=2>)</P></FONT></DIV><FONT face=Arial
size=2>
<DIV>&nbsp;</DIV>
<DIV>Pero me da el siguiente error:</DIV>
<DIV>&nbsp;</DIV><FONT size=1>
<P>[OLE/DB provider returned message: Unspecified error]</P>
<P>OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'
IDBInitialize::Initialize returned 0x80004005: ].</P>
<P>Msg 7399, Level 16, State 1, Line 1</P>
<P>OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. </P></FONT>
<DIV><BR>De aqui he tomado el ejemplo: <A
title="http://support.microsoft.com/kb/321...p;#10;CTRL + clic para seguir el vínculo"
href="http://support.microsoft.com/kb/321...t;>http://support.microsoft.com/kb/321686/es</A></DIV>
<DIV>Alguien me puede dar una luz?&nbsp;</DIV>
<DIV>Muchas gracias</DIV>
<DIV><BR>________________</DIV>
<DIV>&nbsp;</DIV>
<DIV>Geovanny Quirós C.<BR>Heredia, Costa
Rica<BR></FONT></DIV></BLOCKQUOTE></BODY></HTML>

=_NextPart_000_00FF_01C8C721.1C4E2270--
#12 Gux (MVP)
06/06/2008 - 15:49 | Informe spam
Usted debe usar el Surface Area Configuration Tool de SQL Server 2005 y
habilitar el uso de consultas distribuidas, que por omisión están
inhabilitadas (por eso es que usted no está pudiendo usar OPENROWSET o
equivalentes).

Gustavo Larriera, Microsoft MVP
https://mvp.support.microsoft.com/p...o.larriera
Este mensaje se proporciona tal como es, sin garantías de ninguna clase.



"Geovanny Quirós C." wrote:

Mostrar la cita
#13 Geovanny Quirós C.
06/06/2008 - 16:18 | Informe spam
Hola Gustavo:
lo solucioné con sql2005, pero en sql2000 me sigue dando el mismo error...en
el 2000 donde se configura?



"Gux (MVP)" escribió en el mensaje de
noticias:
Mostrar la cita
#14 Gux (MVP)
06/06/2008 - 17:15 | Informe spam
En SQL Server 2000, para que OPENROWSET pueda acceder a un servidor remoto
existe una opción en la registry: DisallowAdhocAccess, debe existir y valer
0. Los detalles están acá:

CÓMO PARA: Utiliza la configuración DisallowAdHocAccess para controlar
acceso a servidor vinculado
http://support.microsoft.com/kb/327489/es

Gustavo Larriera, Microsoft MVP
https://mvp.support.microsoft.com/p...o.larriera
Este mensaje se proporciona tal como es, sin garantías de ninguna clase.



"Geovanny Quirós C." wrote:

Mostrar la cita
#15 Geovanny Quirós C.
06/06/2008 - 18:15 | Informe spam
Gustavo:
He seguido las instrucciones y ya lo he solucionado.
Muchas gracias por todo :)

________________

Geovanny Quirós C.
Heredia, Costa Rica


"Gux (MVP)" escribió en el mensaje de
noticias:
Mostrar la cita
Ads by Google
Search Busqueda sugerida