Home > Ask the SQL Server Experts > Archive: Backup and Recovery Questions & Answers > Query works fine in Query Analyzer, but error via ASP
Ask The SQL Server Expert: Questions & Answers
EMAIL THIS

Query works fine in Query Analyzer, but error via ASP

Greg Robidoux EXPERT RESPONSE FROM: Greg Robidoux

Pose a Question
Other SQL Server Categories
Meet all SQL Server Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 01 July 2004
I'm having a problem executing a query on SQL Server 2000 via ASP. My problem is simple: I am able to execute the query within Query Analyzer without any problems, but when the same statement is executed via the ASP code I receive an access is denied error message. The query is:
SELECT *
INTO jtest2
FROM
OPENROWSET('MSDASQL',
'Driver={Microsoft Text Driver (*.txt;
*.csv)};DEFAULTDIR=C:temp;Extensions=CSV;',
'SELECT * FROM Contacts.CSV')

>

Based on the 'access is denied' error message the problem appears to be related to your rights to the objects versus the account that is used to authenticate to SQL Server. Verify that the account used to authenticate to SQL Server via the ASP code has sufficient rights to the objects and re-execute the code.

For More Information


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Archive: Backup and Recovery
Synchronize databases on two separate active servers
Back up tables from SQL Server 2005 database to a file
Restore SQL Server 2000 backups in SQL Server 2005
Restoring a SQL Server database with a corrupt data file
SQL Server error message: "Server out of memory"
Configure log shipping between SQL Server 2000 and 2005
Restoring from msdb with only .mdf and .ldf files
Extended stored procedure to back up databases
Change tempdb from 'C' drive
Back up stored procedure only

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



SQL Solutions - SQL Database Design
HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2005 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts