Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1103
  • Last Modified:

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

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
Thor_DK
Asked:
Thor_DK
  • 2
1 Solution
 
namasi_navaretnamCommented:
0
 
Thor_DKAuthor Commented:
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
 
Computer101Commented:
PAQed, with points refunded (250)

Computer101
E-E Admin
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now