Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Error when trying to connect to database when running a SQL SELECT on joined tables


Message #1 by "Simon Brookes" <simon.brookes@p...> on Tue, 16 Oct 2001 14:03:19
Well the Subject says it all really.



I get an error when I try to connect to an Access Database when using an 

SQL SELECT Statement on joined tables.



If I remove the join (and just query the one table) I dont get the error.



I know the SQL is correct because I can run it as a query in Access and it 

works fine.



However when I try to run it from my asp page I get this error:



--------------------------------------------------

Microsoft JET Database Engine error '80004005' 



Could not use ''; file already in use. 



/testarea/OPP/test.asp, line 80 

--------------------------------------------------



This is the extract of the page code:

<%

 Dim objCommand, objRS



 Set objCommand = Server.CreateObject("ADODB.Command")

 objCommand.ActiveConnection = StrConnect

 

 objCommand.CommandText = "SELECT OPPF.JobTitle, OPPF.JobId, OPPF.StaffId, 

OPPF.DateOpened, OPPF.Status, Staff.FirstName, Staff.Surname FROM OPPF 

INNER JOIN Staff ON OPPF.StaffId = Staff.StaffId WHERE OPPF.Status 

<> 'complete'"

 objCommand.CommandType = adCmdText

 

 Set objRS = objCommand.Execute

 Set objCommand = Nothing

 

etc..................



Please Help me if you can.



Thanks



Simon



Simon.brookes@p...


  Return to Index