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

Dreamweaver forms,asp files, access databases

Status
Not open for further replies.

scottbacca

Technical User
Aug 30, 2001
6
NZ
Hi,
This is my first go at writing scripts.i want to capture data entered on a form and write it to an access database. I know this subject has been covered previously but i'm still a little confused so any help would be very much appreciated.

OK, heres the situation.

I have created a form in dreamweaver - 2 textboxes (Name and IDand 5x5 groups of radiobuttons. At the moment i'm just seeing if what i enter in the textboxes will be written to an access db table named "table".

In the form header i have the following:
<form method=&quot;post&quot; action=&quot;submissions.asp&quot;>
form layout
<input type='submit' value='Submit'> (at the end)
</form>

The script in my submissions.asp file looks like this:

<%@ Language=&quot;VBScript&quot; %>
<% Option Explicit %>


<%
  Dim Name, ID, sql, conn, cmAdd
  Name = Request.Form(&quot;Name&quot;)
  ID = Request.Form(&quot;ID&quot;)
  sql = &quot;INSERT INTO Table (Name, ID ) VALUES ('&quot;& Name & &quot;', '&quot; & ID & &quot;' );&quot;
     
  'connection
  Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
conn.connectionstring =   &quot;Provider=Microsoft.Jet.OLEDB.4.0; Data Source=p:\st_proto\footy\footy.mdb&quot;
  conn.Open
set cmAdd = Server.CreateObject(&quot;ADODB.Command&quot;)
set cmAdd.ActiveConnection = conn
cmAdd.CommandText = sql
cmAdd.Execute
 conn.Execute(sql)
  conn.Close
  Set conn = nothing

  response.redirect(&quot;thanks.html&quot;)

%>

My problems are:
1. When i hit the &quot;submit&quot; button to submit the form info, a box comes up telling me i'm about to download submissions.asp and do i want to &quot;save it to disk&quot; or &quot;open from its current location&quot;.

My questions are: (and there are so many)
1. Is there anyting wrong with my code?
2. i'm not currently running a web server, do i need to?
3. do i need to have my database in a special place?

ANy help would be fantastic.
Scott


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top