Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Querying a database

Status
Not open for further replies.

ACuba10

Programmer
Jul 25, 2006
14
US
I followed the instruction from thread333-1164595. The problem i am having is that i get "The page cannot be found" when i try to run it. Does anyone know as to why i am getting this message. Am i not testing it correctly. I am attaching my code so that you can see what it is that i am doing.
Code:
<%
'--
Dim a
Dim b
Dim positionofslash
positionofslash = Instr(Request.ServerVariables("LOGON_USER"),"\")
Session("s_cLogon") = MID(Request.ServerVariables("LOGON_USER"),positionofslash+1)

logon = Session("s_cLogon")

IF logon = "" THEN
	Response.Write "Does not have logon id."
	Response.End
END IF

dim conn, rs, sql
set rs = Server.CreateObject("ADODB.Recordset")
set conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" &_
		"Data Source=CORPORATE;" &_
		"Jet OLEDB:System Database=corporate"
		
		
sql="SELECT LastName,FirstName FROM [dbHumanResources].[EMPLOYEE] WHERE SystemLogin = '" & logon & "'"
rs.Open sql, conn

IF rs.EOF THEN 
	Response.Write "Sorry ..... No Records Found"
ELSE
	a=rs("LastName")
	b=rs("FirstName")
	Response.Write a + ", " + b
END IF

rs.Close
%>
 
go to Tools-> internet options -> advanced tab

and then uncheck the box that says "Show HTTP friendly error messages"

try running the page again...then you will see the exact error message...

-DNG
 
you're link seems to be broken.

try this one

You seem to be crossing up your connections strings. aside if you are using jet then .mdb extensions are required


____________ signature below ______________
General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
btw...may have been my browser or router for a minute...connectionstrings.com seems fine now


____________ signature below ______________
General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top