Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 msSQL OpenRowset problems

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-06-30 : 07:19:33
josh writes "Hi there,
I'm having problems coding the query below into ASP.
Can someone please explain why?
Query:
SELECT *
INTO newtable
FROM
OPENROWSET('MSDASQL',
'Driver={Microsoft Text Driver (*.txt; *.csv)};DEFAULTDIR=C:\temp\;Extensions=CSV;',
'SELECT * FROM new.txt')


The query runs fine on msQuery Analizer but when its coded into ASP it breaks with the following error:

Microsoft OLE DB Provider for SQL Server (0x80040E14)
Ad hoc access to OLE DB provider 'MSDASQL' has been denied. You must access this provider through a linked server.


Basically, i'm forced to use this type of insert as the file will be randomly provided by the user and fed into the db.

Any help is appreciated.
Thanks,"

Doug_Bak
Starting Member

9 Posts

Posted - 2004-06-30 : 15:52:00
It's probably either one of two things...

1) You didn't specify the connection you're using. It could be the connection to the database is specified incorrectly

or

2) Does the account that runs the webserver have access to the database?

If you could post some of the page source text, it might help.
Go to Top of Page
   

- Advertisement -