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

ADO updating table probs

Status
Not open for further replies.

wallywojo

Programmer
Aug 30, 1999
36
US
I am writing to an access dbase.&nbsp;&nbsp;When I do the following everything seems to run fine with no run-time errors, but there is a large error because the database is never updated.&nbsp;&nbsp;Any help is appreciated.<br><br>&lt;% option explicit %&gt;<br>&lt;% <br> dim strSQL<br> dim cn<br> dim rs<br> dim strDbase<br> <br> set cn = Server.CreateObject(&quot;ADODB.Connection&quot;)<br> set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)<br> strDbase = Server.MapPath(&quot;web.mdb&quot;)<br> cn.ConnectionString = &quot;PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; & strDBase & &quot;;&quot;<br> cn.open<br> strSQL = &quot;select * from tblWeb &quot; _<br> & &quot;where login like '&quot; & Request(&quot;txtID&quot;) _<br> & &quot;' and password like '&quot; & Request(&quot;txtPass&quot;) & &quot;'&quot; <br> <br> Sub DisplayPasswordForm(strWarning)<br>%&gt;<br><br><br>&lt;------------------HTML stuff--------------------&gt;<br><br>'&nbsp;&nbsp;The routine that checks the login attempt<br><br>Sub ValidateUser<br> rs.Open strSQL, cn, 0, 3<br> if not rs.EOF then<br> Session(&quot;LoggedIn&quot;) = &quot;True&quot;<br> dim counter<br> counter = rs(&quot;visits&quot;) + 1<br> rs(&quot;visits&quot;) = counter<br> rs(&quot;visited&quot;) = Date<br> rs.Update<br> rs.Close<br> cn.Close<br> Response.Redirect &quot;you_made_it.asp&quot;<br> Else<br> DisplayPasswordForm &quot;Password or ID was incorrect!&quot;<br> end if<br>end sub<br> <p>Wally Wojciechowski<br><a href=mailto:wwojo@wilsonpet.com>wwojo@wilsonpet.com</a><br><a href= > </a><br>
 
Check your permissions.&nbsp;&nbsp;Be sure to make sure the file isn't read-only, the NTFS permissions include Delete, and the internal permissions in the database allow updates.&nbsp;&nbsp;If you're using an ODBC connection, check that it's not read-only as well. <p>Monte Kalisch<br><a href=mailto:montek@montekcs.com>montek@montekcs.com</a><br><a href= MVP for ASP</a><br>
 
I am currently contacting the people who host our web site to check the permissions.&nbsp;&nbsp;THank You for your response. <p>Wally Wojciechowski<br><a href=mailto:wwojo@wilsonpet.com>wwojo@wilsonpet.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top