p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_howto thread: Database Connection--Not connecting


Message #1 by "Gail Goring" <Gcg@m...> on Thu, 8 Aug 2002 20:55:45
What is on line 19? Post the first 19 lines of your code. Offhand I would
guess that you may have some illegal characters in your file path to the
database.

regards
David Cameron
nOw.b2b
dcameron@i...

> -----Original Message-----
> From: Gail Goring [mailto:Gcg@m...]
> Sent: Friday, 9 August 2002 6:56 AM
> To: Pro ASP HowTo
> Subject: [proasp_howto] Database Connection--Not connecting
> 
> 
> I have an html page with a text box, 'EmpLastName'.  When I type an 
> employee last name and hit submit I receive the error "Error Type:
> Microsoft JET Database Engine (0x80004005)
> Not a valid file name.
> /ASP/BeginningASP/LastName.asp, line 19.
> 
> I am running Windows 2000 with IIS and my database connection 
> informtion 
> stored in Datastore.asp. 
> 
> This is the code I am using to display the contents of the 
> database that 
> relates to the specific employee.
> 
> All HELP is appreciated.
> 
> Thank you.
> 
> Gail G.
> 
> <%
>   Option Explicit
>   Dim strConnect
> %>
> <!-- #include file="DataStore.asp" -->
> <!-- METADATA TYPE="typelib" 
>               FILE="C:\Program Files\Common 
> Files\System\ado\msado15.dll" -
> ->
> <HTML>
> <HEAD>
> <TITLE>Using SQL's SELECT Command and the ADO Command Object</TITLE>
> </HEAD>
> <BODY>
> <% 
>   Dim objCommand, objRS
>   Set objCommand = Server.CreateObject("ADODB.Command")
> 
>   objCommand.ActiveConnection = strConnect
>   
>   objCommand.CommandText = "SELECT Essential Employee 
> Listing.EmpLastName, 
> Division.DivisionName " & _
>        "FROM Division INNER JOIN Essential Employee Listing 
> INNER JOIN 
> InterSection ON Essential Employee Listing.EmpID = " & _
>        "InterSection.EmpID ON Division.DivisionID = 
> InterSection.DivisionID " & _
>        "WHERE Essential Employee Listing.EmpLastName Like ' " & 
> strEmplLastName & " ' "
>               
>   objCommand.CommandType = adCmdText
> 
>   Set objRS = objCommand.Execute
>   Set objCommand = Nothing
> 
>   While Not objRS.EOF
>     Response.Write objRS("EmpLastName") & " was directed by " & _
>                    objRS("DivisionName") & "<BR>"
>     objRS.MoveNext
>   Wend
>   objRS.Close
>   Set objRS = Nothing
> %>
> </BODY>
> </HTML>
> 


  Return to Index