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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

database connection problem

Status
Not open for further replies.

Ragol1

Programmer
Oct 25, 2001
315
US
I have these two pages set up so that users may change there info but I think the database connection isnt working look at this and see what you think. Also how does each user change there own setting I have 25 members so they would need to login for it to display there information wouldn't they.?
if so how

do I need a <%@LANGUAGE=&quot;VBSCRIPT&quot;%> at the top of the pages
Another question is that is that does this connection require a path /writedatabase/membersragol.mdb
<----this is the first page-------->
<html>
<head>
<title>Member Update Form</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body bgcolor=&quot;#FFFFFF&quot;>
<%
Set Conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Conn.Provider = &quot;Microsoft.Jet.OLEDB.4.0&quot;
Conn.ConnectionString = &quot;Data Source=&quot; & Server.MapPath (&quot;Membersragol.mdb&quot;)
Conn.Open
Set Rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Rs.Open &quot;SELECT * FROM Membersragol WHERE name = '&quot; &Request.Form(&quot;name&quot;) &&quot;'
AND password = '&quot; &Request.Form(&quot;password&quot;) &&quot;'&quot;, Conn, 1, 3
%>
Current Level: <%=RS(&quot;name&quot;)%>
Password: <%=RS(&quot;password&quot;)%>
<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;update.asp&quot;>
<input type=&quot;hidden&quot; value=&quot;<%=RS(&quot;password&quot;)%>&quot; name=&quot;oldpassword&quot;>
<input type=&quot;hidden&quot; value=&quot;<%=RS(&quot;name&quot;)%>&quot; name=&quot;username&quot;>
<p>Level:
<input type=&quot;text&quot; name=&quot;level&quot; size=&quot;20&quot;>
</p>
<p>Password:
<input type=&quot;text&quot; name=&quot;pass&quot; size=&quot;20&quot;>
</p>
<p>
<input type=&quot;submit&quot; value=&quot;Submit&quot; name=&quot;B1&quot;>
</p>
</form>

</body>
</html>
<-----It post's to this page called update.asp------>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body bgcolor=&quot;#FFFFFF&quot;>
<%
Set Conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Conn.Provider = &quot;Microsoft.Jet.OLEDB.4.0&quot;
Conn.ConnectionString = &quot;Data Source=&quot; & Server.MapPath (&quot;Membersragol.mdb&quot;)
Conn.Open
Set Rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Rs.Open &quot;SELECT * FROM Membersragol WHERE name = '&quot; &Request.Form(&quot;name&quot;) &&quot;'
AND password = '&quot; &Request.Form(&quot;oldpassword&quot;) &&quot;'&quot;, Conn, 1, 3
Rs(&quot;level&quot;) = Request.Form(&quot;level&quot;)
Rs(&quot;password&quot;) = Request.Form(&quot;oldpassword&quot;)
Rs.Update
Rs.close
Set RS = Nothing
Set Conn = Nothing
Response.Write &quot;Updated database&quot;

%>

</body>
</html>
 
raqol1,

I think you need a space between some variables and quotes.

Rs.Open &quot;SELECT * FROM Membersragol WHERE name = '&quot; & Request.Form(&quot;name&quot;) & &quot;' AND password = ' &quot; & Request.Form(&quot;oldpassword&quot;) & &quot;' &quot;, Conn, 1, 3

fengshui_1998
 
Thanks but that didnt work I cannot even display the first page which is updt.asp
 
Yes, you need the language declaration (unless you have front page extensions that automatically set the default language), and no, you don't need the path, because server.mappath is already returning that to your script.

What error are you getting?

:)
paul
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top