
August 14th, 2000, 12:21 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
simple problem/fix?
<i><b>Originally posted by : Curtis (eludz@hotmail.com)</b></i><br />please help me with this simple test code that doesn't seem to work for some reason.. I bought the book active server pages 2.0 and I'm trying to use the logic but it doesn't seem to be working.. and I don't really want to use a DSN, so I tried this and it didn't work.. can someone please help me figure out why.. the easiest way to help I think would be to create an access database named "small.mdb" with "Name, Address and Phone" as the fields, and put it a directory named "c:wwwrootsmall" and then just put these next to small files in the "c:wwwrootsmall" directory as well. Then just open "form.html" in your browswer to test it, and for some reason it doesn't do anything.. nothing gets added to the database and nothing changes on the screen even though I have a respone.write at the beginning of the ".asp" file below. PLEASE HELP!<br /><br />then just make a directory called "small"thanks.. <br /><br />--- file=c:wwwrootsmallform.html ---<br /><html><br /><head><br /><title>Test Form</title><br /><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br /></head><br /><br /><body bgcolor="#FFFFFF"><br /><form method="get" action="addnew.asp" name="form1"><br /> <p align="center">Name: <br /> <input type="text" name="txtName"><br /> Phone: <br /> <input type="text" name="txtPhone"><br /> </p><br /> <p align="center"> Address: <br /> <textarea name="txtAddress" cols="50" rows="2"></textarea><br /> </p><br /></form><br /><div align="center"><br /> <input type="submit" name="btnSubmit" value="send"><br /></div><br /></body><br /></html><br /><br />--- file=c:wwwrootsmalladdnew.asp ---<br /><br /><%@ LANGUAGE="VBSCRIPT" %><br /><HTML><br /><HEAD><br /><title>Test UPDATE</title><br /></HEAD><br /><body bgcolor="#FFFFFF" text="#000000" link="#804040" vlink="#008080" alink="#004080"><br /><%<br />dim conn<br />dim rs<br /><br />response.write("hello")<br />set conn = server.createobject("adodb.connection")<br />'conn.open "Small"<br />'conn.open "database=small;dsn=Small;uid=;password=;"<br />conn.connectionstring = "driver={microsoft access driver (*.mdb)};dbq=" & server.mappath("small.mdb")<br />conn.open<br /><br />set rs = server.creatobject("adodb.recordset")<br />'rs.activeconnection = "Small"<br />rs.addnew<br />rs.fields("Name") = request.form(txtName)<br />rs.fields("Phone") = request.form(txtPhone)<br />rs.fields("Address") = request.form(txtAddress)<br />rs.update<br /><br />response.write("<I>DATABASE UPDATED SUCCESSFULLY!</I><BR>")<br />response.write rs.fields("Name")<br /><br />'close connection & database<br />rs.close<br />conn.close<br /><br />'clear local variables out of memory<br />set rs = nothing<br />set conn = nothing<br />%><br /></BODY><br /></HTML><br /><br />--- please verify my form setup and submit button.. there might be a problem there.. thanks.
|