hello everyone.
I recently changed the database of a project from Ms Access to SQL
server and had to make a lot of adjustments but there's one here
where
I can't figure it out how to do this in SQL server.
I was using the following to create an excel file based on the select
from Ms Access.
"SELECT * INTO [Excel 8.0;Database=" & server.mapPath("../documents/
example.xls].[sheet1]")&" FROM (SELECT * FROM TABLE1)"
This was working fine until the bd was changed to Ms Server 2005
where
it occurs an error. I will post the error even if its kind useless.
Error:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near ')'.
As I said, the exact same code works fine in access. Any sugestion
how
to get this solved'
I know some turn arounds like create a content/type x-excel page and
this allow the user to save the file, but I really need is to create
the file .XLS on the disk to allow the user to download whenever they
want.
Any help is highly appreciated.
Thanks in advance
JoaoHi
You can create a linked server to EXCEL file.BOL has pretty good explanation
about the subject among with examples
<joaotsetsemoita@.gmail.com> wrote in message
news:1191855011.546016.198450@.r29g2000hsg.googlegroups.com...
> hello everyone.
> I recently changed the database of a project from Ms Access to SQL
> server and had to make a lot of adjustments but there's one here
> where
> I can't figure it out how to do this in SQL server.
>
> I was using the following to create an excel file based on the select
> from Ms Access.
>
> "SELECT * INTO [Excel 8.0;Database=" & server.mapPath("../documents/
> example.xls].[sheet1]")&" FROM (SELECT * FROM TABLE1)"
>
> This was working fine until the bd was changed to Ms Server 2005
> where
> it occurs an error. I will post the error even if its kind useless.
>
> Error:
> Microsoft OLE DB Provider for SQL Server error '80040e14'
> Incorrect syntax near ')'.
>
> As I said, the exact same code works fine in access. Any sugestion
> how
> to get this solved'
>
> I know some turn arounds like create a content/type x-excel page and
> this allow the user to save the file, but I really need is to create
> the file .XLS on the disk to allow the user to download whenever they
> want.
>
> Any help is highly appreciated.
>
> Thanks in advance
>
> Joao
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment