Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Microsoft OLE DB Provider for SQL Server (0x80040E37)

Posted on 2006-03-31
14
Medium Priority
?
807 Views
Last Modified: 2012-05-05
I have an ASP page to test the connection and pull details from a small table. I get this error when I try to print the contents of that table. When I remove that line, I can see that the connection workd fine.

<%
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.RecordSet")
conn.Open "Provider=SQLOLEDB; Data Source = mlvv1qba; Initial Catalog = Build_Summary; User Id = Builder; Password=Builder"
If conn.errors.count = 0 Then
Response.Write "Connected OK"
End If
mQuery = "SELECT * FROM Problems"
set rs=conn.execute(mQuery)
response.write(rs(0))
%>

Any suggestions?
0
Comment
Question by:n4narik
  • 8
  • 6
14 Comments
 
LVL 19

Expert Comment

by:nschafer
ID: 16345362
Hi n4narik,

Verify that the table Problems exsists in the Build_Summary Database.


Hope this helps,
Neal.
0
 

Author Comment

by:n4narik
ID: 16345383
Yes, the table exists.

Thanks.
0
 
LVL 19

Expert Comment

by:nschafer
ID: 16345400
n4narik,

Which line does the error occur on?

Neal.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:n4narik
ID: 16345420
Line 17.

Thanks.
0
 

Author Comment

by:n4narik
ID: 16345429
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E37)
Invalid object name 'Problems'.
/ravi/sql2000test.asp, line 17


0
 

Author Comment

by:n4narik
ID: 16345439
Ok, the line 17 is now this line:  set rs=conn.execute(mQuery)
0
 
LVL 19

Expert Comment

by:nschafer
ID: 16345486
Try changing the connection

Conn.open("Provider=sqloledb;Server=YourServerName;Database=Build_Summary;uid=youruserid;password=yourpassword;")

Make sure you put in your server name, UserId and Password and see if this makes a difference.  

Neal.
0
 

Author Comment

by:n4narik
ID: 16345577
No. It says cannot connect.
0
 
LVL 19

Expert Comment

by:nschafer
ID: 16345811
OK, lets put your connection string back the way it was and try running this SQL query in place of your current one.

mQuery = "SELECT T.TABLE_NAME AS [Table] FROM INFORMATION_SCHEMA.Tables T " &_
                 "WHERE T.TABLE_NAME NOT LIKE 'sys%' AND T.TABLE_NAME <> 'dtproperties' " &_
                 "AND T.TABLE_SCHEMA <> 'INFORMATION_SCHEMA' ORDER BY T.TABLE_NAME "

This should display a list of all the tables in your current database.  Verify that Problems is in the list.  

The error message you originally posted is that the object doesn't exist, so for some reason it is not seeing the Problems table.  This might help us find out why.

Neal.
0
 

Author Comment

by:n4narik
ID: 16345916
I see the tables Neal.
The Problems table is in the list.

I've increased the points to 500.
0
 

Author Comment

by:n4narik
ID: 16345984
Ok, I think I've figured out the problem. When I get into the View of the table from SQL2000 client, I see [myID].[TableName]
So, I used that name to pull data and it worked fine.
How can I stop using those names, and use the regular table name to get the data?
0
 
LVL 19

Accepted Solution

by:
nschafer earned 2000 total points
ID: 16346079
I was just writing this when your post came in:
-----------------------------------------
Just for fun let's try something simple
change
  mQuery = "Select * from Problems"
to
  mQuery = "Select * from [Problems]"

Sometimes you run across the strangest reserved words
-------------------------------------------

[myID].[TableName] is standard SQL nomenclature for a table.  This references the user and tablename together.  This is sometimes required if the table name is a reserved word or has spaces.  The UserID part may be dropped which leaves you with what I have above.

Neal.
0
 

Author Comment

by:n4narik
ID: 16346305
For your time and effort!
0
 
LVL 19

Expert Comment

by:nschafer
ID: 16346352
No, problem.  Did that solve the problem?
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question