Ask a Question related to ASP Database, Design and Development.
-
Mark #1
Exporting tables via ODBC from SQL SERVER
I need to provide a way for a client to pull information
from SQL Server to Word, Excel, etc. via a web browser
using Active Server Pages.
I was going to just write a little utility that output CSV
files to the browser based on the query, but thought I
would see if there was a "better" way.
I see some examples of doing something like:
SELECT * INTO
[Text;FMT=Delimited;HDR=Yes;DATABASE=C:\TEMP;].
[OutFile#txt] FROM TestTable
However when I do this I get an error like
[Microsoft][ODBC SQL Server Driver][SQL Server]Specified
owner name 'Text;FMT=Delimited;HDR=Yes;DATABASE=C:\TEMP;'
either does not exist or you do not have permission to use
it.
I've tried all the variations I have found and can think
of. Is this something you just can't do from ASP? Or am I
just missing something obvious?
Appreciate any insights or examples.
Mark
Mark Guest
-
ODBC\JDBC on same server
We are building a new Windows server. One of the ColdFusion (MX 7) Admins created a slew of DSNs but when I looked for them I couldn't find a... -
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
Hi, I am able to retrieve data from database and then the object name is fine, say SELECT * FROM problemdb, but when I try to use INSERT, I get... -
Undefined tables after exporting slices in MX 2004
Why is it that I get undefined borders, cell spacing, cell padding, etc. when I export slices to Dreamweaver? Isn't there a default setting to change? -
Exporting Different Tables to Same Flat File
If you cannot find a why to do it, consider making two files and then use DOS XCOPY (or whatever) to combine them into one. Bye, Delbert Glass... -
8.1.7.4.0 Server & 8.05 ODBC
We've recently upgraded from an 8.05 server to 8.1.7.4.0. I'm still using the ODBC driver for 8.05 but have been experiencing problems, so I've... -
Aaron Bertrand - MVP #2
Re: Exporting tables via ODBC from SQL SERVER
> I see some examples of doing something like:
Not from SQL Server, I don't think.> SELECT * INTO
> [Text;FMT=Delimited;HDR=Yes;DATABASE=C:\TEMP;].
> [OutFile#txt] FROM TestTable
[url]http://www.aspfaq.com/2482[/url]
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
Aaron Bertrand - MVP Guest
-
onedaywhen #3
Re: Exporting tables via ODBC from SQL SERVER
This syntax is for Jet, not SQL Server.
--
"Mark" <mark@sloanadams.com> wrote in message news:<532a01c3d966$3ea1f980$7d02280a@phx.gbl>...> I need to provide a way for a client to pull information
> from SQL Server to Word, Excel, etc. via a web browser
> using Active Server Pages.
> I was going to just write a little utility that output CSV
> files to the browser based on the query, but thought I
> would see if there was a "better" way.
>
> I see some examples of doing something like:
> SELECT * INTO
> [Text;FMT=Delimited;HDR=Yes;DATABASE=C:\TEMP;].
> [OutFile#txt] FROM TestTable
> However when I do this I get an error like
>
> [Microsoft][ODBC SQL Server Driver][SQL Server]Specified
> owner name 'Text;FMT=Delimited;HDR=Yes;DATABASE=C:\TEMP;'
> either does not exist or you do not have permission to use
> it.
>
> I've tried all the variations I have found and can think
> of. Is this something you just can't do from ASP? Or am I
> just missing something obvious?
>
> Appreciate any insights or examples.
>
> Markonedaywhen Guest
-
Re: Exporting tables via ODBC from SQL SERVER
I realize that what I am writing into is Jet, but my
connection is to SQL server. So, does that mean that I
cannot do this at all or is there some way around it?
Marknews:<532a01c3d966$3ea1f980$7d02280a@phx.gbl>...>-----Original Message-----
>This syntax is for Jet, not SQL Server.
>
>--
>
>"Mark" <mark@sloanadams.com> wrote in messageinformation>> I need to provide a way for a client to pullCSV>> from SQL Server to Word, Excel, etc. via a web browser
>> using Active Server Pages.
>> I was going to just write a little utility that outputSpecified>> files to the browser based on the query, but thought I
>> would see if there was a "better" way.
>>
>> I see some examples of doing something like:
>> SELECT * INTO
>> [Text;FMT=Delimited;HDR=Yes;DATABASE=C:\TEMP;].
>> [OutFile#txt] FROM TestTable
>> However when I do this I get an error like
>>
>> [Microsoft][ODBC SQL Server Driver][SQL Server]name 'Text;FMT=Delimited;HDR=Yes;DATABASE=C:\TEMP;'>> owneruse>> either does not exist or you do not have permission tothink>> it.
>>
>> I've tried all the variations I have found and canI>> of. Is this something you just can't do from ASP? Or am>.>> just missing something obvious?
>>
>> Appreciate any insights or examples.
>>
>> Mark
>Guest
-
onedaywhen #5
Re: Exporting tables via ODBC from SQL SERVER
*Must* your connection be to SQL Server? Could you instead connect to
a Jet source i.e. using the Jet OLEDB provider? It needn't be an .mdb
file (MS Access), it could be an existing, but totally arbitrary,
Excel workbook (but it can't be the text file folder, it seems). For
example, assuming ADO, your connection string would be something like:
Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Temp\MyWorkbook.xls;Extended Properties='Excel 8.0'
You could then specify the connection to both the text file folder
*and* SQL Server in the query e.g.
SELECT MyCol1, MyCol2
INTO [Text;FMT=Delimited;HDR=Yes;DATABASE=C:\TEMP\;].[OutFile#txt]
FROM [ODBC;Driver={SQL
Server};SERVER=MyServer;DATABASE=MyDB;UID=;Pwd=;].MyTable
Note that you can use a SELECT..INTO query to create a new
workbook/worksheet, rather than a text file e.g.
SELECT MyCol1, MyCol2
INTO [Excel 8.0;database=C:\TEMP\NewWorkbook.xls;].Sheet1
FROM [ODBC;Driver={SQL
Server};SERVER=MyServer;DATABASE=MyDB;UID=;Pwd=;].MyTable
If you *must* be connected SQL Server, you will have to use SQL Server
methods e.g. take a look at OPENROWSET.
--
<anonymous@discussions.microsoft.com> wrote in message news:<0c8501c3d9f8$28b986f0$a501280a@phx.gbl>...> I realize that what I am writing into is Jet, but my
> connection is to SQL server. So, does that mean that I
> cannot do this at all or is there some way around it?
>
> Mark> news:<532a01c3d966$3ea1f980$7d02280a@phx.gbl>...> >-----Original Message-----
> >This syntax is for Jet, not SQL Server.
> >
> >--
> >
> >"Mark" <mark@sloanadams.com> wrote in message> information> >> I need to provide a way for a client to pull> CSV> >> from SQL Server to Word, Excel, etc. via a web browser
> >> using Active Server Pages.
> >> I was going to just write a little utility that output> Specified> >> files to the browser based on the query, but thought I
> >> would see if there was a "better" way.
> >>
> >> I see some examples of doing something like:
> >> SELECT * INTO
> >> [Text;FMT=Delimited;HDR=Yes;DATABASE=C:\TEMP;].
> >> [OutFile#txt] FROM TestTable
> >> However when I do this I get an error like
> >>
> >> [Microsoft][ODBC SQL Server Driver][SQL Server]> name 'Text;FMT=Delimited;HDR=Yes;DATABASE=C:\TEMP;'> >> owner> use> >> either does not exist or you do not have permission to> think> >> it.
> >>
> >> I've tried all the variations I have found and can> I> >> of. Is this something you just can't do from ASP? Or am> >.> >> just missing something obvious?
> >>
> >> Appreciate any insights or examples.
> >>
> >> Mark
> >onedaywhen Guest



Reply With Quote

