Solved

View causes "Data provider or other service returned an E_FAIL status" and "Connection Failure"

Posted on 2003-10-28
5
1,087 Views
Last Modified: 2007-12-19
Every time I call the simple view below from the database window I get the first screen with the result.
But when I try to go to the next page using the PageDown key I get an error message:

Data provider or other service returned an E_FAIL status

and after that the content of all records are blanked and after a second I get another error message

Connection Failure

I have to close the projekt to be able to se any view. All other views and stored procedures works without errors.

SELECT tblAdresse.Fornavn, tblAdresse.Efternavn,
    tblAdresse1.Firma, tblAdresse1.Adresse,
    tblAdresse1.Adresse2, tblAdresse1.Postnummer
FROM dbo.tblAdresse INNER JOIN
    dbo.tblTjenestested ON
    dbo.tblAdresse.AdresseID = dbo.tblTjenestested.PersonID INNER
     JOIN
    dbo.tblAdresse tblAdresse1 ON
    dbo.tblTjenestested.TjenestestedID = tblAdresse1.AdresseID

The project is on a Windows 2000 pc with Access 2000 adp project-file running up against a MS SQL server Enterprise Edition version 8.00.194 (RTM) running MS Windows 2000 (5.0 2195).  BTW I use MDAC version 2.60.6526.2
0
Comment
Question by:Thor_DK
  • 2
5 Comments
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 9638580
0
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 9638590
0
 
LVL 1

Author Comment

by:Thor_DK
ID: 9640476
Thanks a lot, but none of the two suggestions apply to the solution of the problem.
But I've just found the solution.

Table tblAdresse is used twice in the SQL statement - the second version is called tblAdresse1.
This seems to confuse the SQL server. So after adding a new view (viewAdresse) that's just all records in tblAdresse and replacing the secord version the view works fine.

So the final SQL statement now looks like this

SELECT tblAdresse.Fornavn, tblAdresse.Efternavn,
    viewAdresse.Firma, viewAdresse.Adresse,
    viewAdresse.Adresse2, viewAdresse.Postnummer
FROM dbo.tblAdresse INNER JOIN
    dbo.tblTjenestested ON
    dbo.tblAdresse.AdresseID = dbo.tblTjenestested.PersonID INNER
     JOIN
    dbo.tblAdresse viewAdresse ON
    dbo.tblTjenestested.TjenestestedID = viewAdresse.AdresseID

I wonder if is a Server bug, or because I'm using an illegal SQL statement that passes the SQL check.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 9663392
PAQed, with points refunded (250)

Computer101
E-E Admin
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
query execution hang 5 32
Help creating a spatial object in SQL Server 4 23
Flattening heirachies 3 31
sqlserver get datetime field and create a string 5 18
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

803 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