Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Problem with accessing a table in SQL 7 Database


Message #1 by "Adam" <asinclair79@h...> on Tue, 17 Apr 2001 21:06:00
I get the following error when I try to query a table "News" in my Sql 

database.



Microsoft OLE DB Provider for ODBC Drivers (0x80040E37)

[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'News'.



If I write the query statments from my ASP document, directly into SQL 

through the Query Analyzer, everything works beautifully. However, when I 

run the same queries from an ASP script I get the above error. Thanks in 

advance.



Adam
Message #2 by "Tomm Matthis" <matthis@b...> on Tue, 17 Apr 2001 17:22:55 -0400
Could you post the SQL statement and the line where you Open / excute 

the line for us?



Tomm



> -----Original Message-----

> From: Adam [mailto:asinclair79@h...]

> Sent: Tuesday, April 17, 2001 9:06 PM

> To: ASP Databases

> Subject: [asp_databases] Problem with accessing a table in SQL 7

> Database

>

>

> I get the following error when I try to query a table "News" in my Sql 



> database.

>

> Microsoft OLE DB Provider for ODBC Drivers (0x80040E37)

> [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 

'News'.

>

> If I write the query statments from my ASP document, directly into SQL 



> through the Query Analyzer, everything works beautifully. However, 

when I

> run the same queries from an ASP script I get the above error. Thanks 

in

> advance.

>

> Adam

> ---

> SoftArtisans helps developers build robust, scalable Web applications!

> Excel Web reports, charts: 

http://www.softartisans.com/excelwriter.html

> File uploads: http://www.softartisans.com/saf.html

> Transactional file management: http://www.softartisans.com/saf1.html

> Scalability: http://www.softartisans.com/saxsession.html

> ASPstudio value pack: http://www.softartisans.com/aspstudiosuite.html




> $subst('Email.Unsub')

>

>



Message #3 by "Antonello Corbo" <antonello65@l...> on Tue, 17 Apr 2001 23:41:56 +0200
check that the default database is configured properly

bye

----- Original Message -----

From: "Adam" <asinclair79@h...>

To: "ASP Databases" <asp_databases@p...>

Sent: Tuesday, April 17, 2001 21:06

Subject: [asp_databases] Problem with accessing a table in SQL 7

Database





> I get the following error when I try to query a table "News" in my Sql

> database.

>

> Microsoft OLE DB Provider for ODBC Drivers (0x80040E37)

> [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name

'News'.

>

> If I write the query statments from my ASP document, directly into SQL

> through the Query Analyzer, everything works beautifully. However,

when I

> run the same queries from an ASP script I get the above error. Thanks

in

> advance.

>

> Adam

> 
Message #4 by "Eric Van Camp" <eric@a...> on Tue, 17 Apr 2001 23:33:11 +0200
1°stop and start your sql server 7

2°did you try to write your sql query on the screen ' response.write sql

3°was the table correctly named in your query?

4°Is your dsn the correct one( are you connecting to the correct

database)(sometimes see your include file for connection string)



Please give more info..preferrably the code...

txs

Eric

-----Original Message-----

From: Adam [mailto:asinclair79@h...]

Sent: Tuesday, April 17, 2001 11:06 PM

To: ASP Databases

Subject: [asp_databases] Problem with accessing a table in SQL 7

Database





I get the following error when I try to query a table "News" in my Sql

database.



Microsoft OLE DB Provider for ODBC Drivers (0x80040E37)

[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'News'.



If I write the query statments from my ASP document, directly into SQL

through the Query Analyzer, everything works beautifully. However, when I

run the same queries from an ASP script I get the above error. Thanks in

advance.



Adam



Message #5 by "Charles Feduke" <webmaster@r...> on Tue, 17 Apr 2001 18:00:54 -0400
    This sounds like a ODBC connection problem.  If your connection object

is logging into the database as a different user (i.e. "sa") and you did not

check "Change Default Database To:" and/or you did not select a value for it

when you set up the ODBC connection, you're probably hitting that user's

default database (master for sa).  Check the ODBC connection or use fully

qualified paths to your object (try "dbo.News" instead of just "News").



- Chuck



----- Original Message -----

From: "Adam" <asinclair79@h...>

To: "ASP Databases" <asp_databases@p...>

Sent: Tuesday, April 17, 2001 9:06 PM

Subject: [asp_databases] Problem with accessing a table in SQL 7 Database





> I get the following error when I try to query a table "News" in my Sql

> database.

>

> Microsoft OLE DB Provider for ODBC Drivers (0x80040E37)

> [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'News'.

>

> If I write the query statments from my ASP document, directly into SQL

> through the Query Analyzer, everything works beautifully. However, when I

> run the same queries from an ASP script I get the above error. Thanks in

> advance.

>

> Adam

>
Message #6 by "Adam" <asinclair79@h...> on Wed, 18 Apr 2001 00:51:35
That's exactly what the problem was Chuck. Thank you so much. 



Adam





>     This sounds like a ODBC connection problem.  If your connection 

object

> is logging into the database as a different user (i.e. "sa") and you did 

not

> check "Change Default Database To:" and/or you did not select a value 

for it

> when you set up the ODBC connection, you're probably hitting that user's

> default database (master for sa).  Check the ODBC connection or use fully

> qualified paths to your object (try "dbo.News" instead of just "News").

> 

> - Chuck

> 


  Return to Index