Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - help with INSERT FORM DATA TO DATABASE
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

help with INSERT FORM DATA TO DATABASE

 Post Reply Post Reply
Author
zadax View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 19 January 2003
Location: Israel
Status: Offline
Points: 433
Post Options Post Options   Thanks (0) Thanks(0)   Quote zadax Quote  Post ReplyReply Direct Link To This Post Topic: help with INSERT FORM DATA TO DATABASE
    Posted: 10 May 2003 at 2:28pm

ok look on this :

The first thing you need to do is create a formpage.asp page with the code below:

<form name="YourFormName" method="Post" action="resultspage.asp">
<table>
<tr><td>Email: </td>
<td><input type="text" name="Email" size="50"></td></tr>
<tr><td>Name: </td>
<td><input type="text" name="Name" size="50"></td></tr>
<tr><td>Comments: </td>
<td><textarea name="Comments"></textarea></td>
</table>

<input type="submit" name="Submit" value="Submit Form">
</FORM>

Next, we create a resultspage.asp page and enter the code as seen below:

<!--#INCLUDE VIRTUAL="/includes/connection.asp" -->

<%
DIM objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "YOUR table name HERE", objConn, , adLockOptimistic, adCmdTable

objRS.AddNew
objRS("Email") = Request.Form("Email")
objRS("Name") = Request.Form("Name")
objRS("Comments") = Request.Form("Comments")
objRS.Update

objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>

<p>
<%
DIM strName
strName = Request.Form("Name")
Response.Write strName
%>,</p>

<p>Thank you for emailing me.</>

 

its From aspwebpro .

i m Stuck here : <!--#INCLUDE VIRTUAL="/includes/connection.asp" -->

what the hell he want from me ?  Where is that page ? its not Exsist .

i need to Make it right ?  if so how ?  

oh and i need to make Db or somthing ?

can somone help me

Edit :

ok i understand i need to open Conection to the Db ... How to do it ?

and How i make the Db ? (i have Access)



Edited by zadax
Back to Top
zadax View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 19 January 2003
Location: Israel
Status: Offline
Points: 433
Post Options Post Options   Thanks (0) Thanks(0)   Quote zadax Quote  Post ReplyReply Direct Link To This Post Posted: 10 May 2003 at 2:32pm

ok i think i found the Answer for the Conection thing it shuld be :

<%
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=myCONNECTION.dsn"
objConn.Open
%>

This example uses a DSN-less connection:

<%
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("/mydatabase.mdb") & ";"
objConn.Open
%>

 

i need to Write this in Page called CONNECTION.asp right ?

ok now ..... How i make The Db ?

Back to Top
zadax View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 19 January 2003
Location: Israel
Status: Offline
Points: 433
Post Options Post Options   Thanks (0) Thanks(0)   Quote zadax Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2003 at 6:47am
no one gonna help me
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2003 at 8:26am

You need to make the db in access.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.