Hi, I have just moved from a DSNLess connection to try and resolve some provider error messages I was getting. However the problem I have now is that the code below will run quite happily with admin rights but when I use a user account I get the dreaded '800004005' [ODBC Driver Manager]Data Source name not found and no default driver specified.
This runs in an NT Authenticated environment, anonymous is disabled and the iusr_machine account is not used.
I thought System DSN's were available to all users so although this seems like a rights issue I do not understand where it is coming from. Any help greatly appreciated.
End of the day in Europe so will not see replies until tomorrow.
TIA
This runs in an NT Authenticated environment, anonymous is disabled and the iusr_machine account is not used.
I thought System DSN's were available to all users so although this seems like a rights issue I do not understand where it is coming from. Any help greatly appreciated.
End of the day in Europe so will not see replies until tomorrow.
TIA
Code:
<%option explicit
dim dsn,conn,rs,sql,x
dim flag,color,useraction,element
useraction=request.querystring("action")
select case useraction
case "search"
x = 0
sql = "select * from users where id>0"
dsn="CSOLPhone"
set conn = server.createObject("adodb.connection")
set rs = server.createObject("adodb.recordset")
conn.open dsn
for each element in request.form
if request.form(element)<>"" then
select case element
case "tel"
sql=sql & " and tel = '" & Request.form(element) & "'"
case "lname"
sql=sql & " and lname like '" & Request.form(element) & "%'"
case "fname"
sql=sql & " and fname like '" & Request.form(element) & "%'"
case "init"
sql=sql & " and init like '" & Request.form(element) & "%'"
case "mobile"
sql=sql & " and mobile like '" & Request.form(element) & "%'"
case "dept"
sql=sql & " and dept like '" & Request.form(element) & "%'"
end select
end if
next
sql=sql & " order by lname"
'response.write sql'***debug
rs.open sql,conn
if rs.eof and rs.bof then
response.write "No Record Found"
else
response.write "<table width=550 border=0><th align=left>Last Name</th><th align=left>First Name</TH>"
response.write "<th align=left>Tel</TH><th align=left>Mobile</TH><th align=left>Initials</TH><th align=left>Dept</TH>"
do while not rs.eof
if flag=0 then
flag=1
color="#A5C3C3"
else
flag=0
color="#FFFFC0"
end if
response.write "<TR bgcolor="& color & "><TD>"
response.write RS("lname") & "</td><td>" & RS("fname") & "</td><td>"
response.write RS("tel") & "</td><td>" & RS("mobile") & "</td><td>" & RS("init") & "</td><td>"
response.write RS("dept") & "</tr></td>"
rs.movenext
x=x+1
loop
response.write "<tr><td colspan=7>Total Records : " & x & "</table>"
end if
end select
%>
<script>function rusure() {
if (confirm("Are you sure you want to delete?")) {
return true;
} else {
return false;
}
}
</script>
<head>
<style>
a:hover{color:red}
</style>
<title>Telephone Directory</title>
</head>
<body link="#000080" vlink="#000080" alink="#000080">
<div align="center">
<center>
<table border="0" width="450" cellspacing="0" cellpadding="3" style="border:1px groove #B52100; border-collapse:collapse" bordercolor="#111111">
<tr><td colspan="2" align="center">
<p align="center"><img border="0" src="IMAGES/main.png"></tr>
<form action="search.asp?action=search" method="post">
<tr><td colspan="2" align="center" bgcolor="#B52100"><font face="Verdana" color="#FFFFFF" size="1"> Clicking on
<b> search</b> without choosing any category will retrieve all records</font></tr>
<tr><td bgcolor="#C0C0C0">
<font face="Verdana" size="2" color="#B52100">
Search by Last name:(A-Z)</font></td><td bgcolor="#C0C0C0">
<font face="Verdana" color="#B52100"><input type="text" name="lname" size="25" maxlength="25"></font></tr>
<tr><td bgcolor="#C0C0C0">
<font face="Verdana" size="2" color="#B52100">
Search by First name:(A-Z)</font></td><td bgcolor="#C0C0C0">
<font face="Verdana" color="#B52100"><input type="text" name="fname" size="25" maxlength="25"></font></tr>
<tr><td bgcolor="#C0C0C0">
<font face="Verdana" size="2" color="#B52100">
Search by Phone No .:</font></td><td bgcolor="#C0C0C0">
<font face="Verdana" color="#B52100"><input type="text" name="tel" size="10" maxlength="5"></font></tr>
<tr><td bgcolor="#C0C0C0">
<font face="Verdana" size="2" color="#B52100">
Search by Initials</font></td><td bgcolor="#C0C0C0">
<font face="Verdana" color="#B52100"><input type="text" name="init" size="5" maxlength="5"></font></tr>
<tr><td bgcolor="#C0C0C0">
<font face="Verdana" size="2" color="#B52100">
Search by Department</font></td><td bgcolor="#C0C0C0">
<font face="Verdana" color="#B52100"><input type="text" name="dept" size="25" maxlength="25"></font></tr>
<tr><td align="center" bgcolor="#C0C0C0">
<table border="0" width="100%">
<tr>
<td width="33%"></td>
<td width="33%" style="border: 2px outset #B52100; " align="center">
<p align="center"><font face="Verdana" size="2"><a href="search.asp" style="text-decoration:none">
<font color="#B52100">Clear</font></a></font></td>
<td width="34%"></td>
</tr>
</table>
<td align="center" bgcolor="#C0C0C0">
<font face="Verdana" color="#B52100">
<input type="submit" value="Search" style="border:2px ridge #B52100; background-color: #C0C0C0; "></font></tr>
</table>
</center>
</div>
<p align="center">
</a></p>
</body>