Below is the code I'm trying to use followed by the results
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<%
function GetStartHours(CustomerNo)
dim db
response.write "Start"
Set Conn = Server.CreateObject("ADODB.Connection"
response.write "Connect"
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & _
Server.MapPath("\fpdb\extranet.mdb" & ";PWD="
response.write "Finnished Conecting"
set rst = db.Execute("SELECT Customers.CustomerNo, Customers.StartingHours FROM Customers WHERE (((Customers.CustomerNo)=" & CustomerNo & ");"
select case rst.eof
case true
GetStartHours = 0
case false
rst.movefirst
GetStartHours = rst.StartingHours
end select
end function
function StripDomain(strLogonUser)
strLogonUser = Replace(strLogonUser,"/","\"
StripDomain = Right(strLogonUser, (Len(strLogonUser) - inStrRev(strLogonUser, "\", -1,vbTextCompare)))
end function
if request("LOGON_USER" = "" Then
response.clear
response.Status = "401 Unauthorized"
end if
MyUser = StripDomain(Request.ServerVariables("Logon_User")
response.write "Start Hours = " & GetStartHours(MyUser)
%>
</BODY>
</HTML>
Results:
StartConnect
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'.
/dbdemo/ConnTest.asp, line 19
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<%
function GetStartHours(CustomerNo)
dim db
response.write "Start"
Set Conn = Server.CreateObject("ADODB.Connection"
response.write "Connect"
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & _
Server.MapPath("\fpdb\extranet.mdb" & ";PWD="
response.write "Finnished Conecting"
set rst = db.Execute("SELECT Customers.CustomerNo, Customers.StartingHours FROM Customers WHERE (((Customers.CustomerNo)=" & CustomerNo & ");"
select case rst.eof
case true
GetStartHours = 0
case false
rst.movefirst
GetStartHours = rst.StartingHours
end select
end function
function StripDomain(strLogonUser)
strLogonUser = Replace(strLogonUser,"/","\"
StripDomain = Right(strLogonUser, (Len(strLogonUser) - inStrRev(strLogonUser, "\", -1,vbTextCompare)))
end function
if request("LOGON_USER" = "" Then
response.clear
response.Status = "401 Unauthorized"
end if
MyUser = StripDomain(Request.ServerVariables("Logon_User")
response.write "Start Hours = " & GetStartHours(MyUser)
%>
</BODY>
</HTML>
Results:
StartConnect
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'.
/dbdemo/ConnTest.asp, line 19