Skip to main content
Participant
December 20, 2007
Question

How to save data to access database in dreamweaver

  • December 20, 2007
  • 1 reply
  • 1500 views
Hello,
I want to save data from webpage to MS access database. I am using dreamweaver MX 2004 developing tool. For server side scripting I am using asp page but I am not geting any result. And I am calling this asp page using HTML codes (using "action").
Please anybody suggest me proper way for this.
This topic has been closed for replies.

1 reply

Inspiring
December 20, 2007
You want to create a form on your page with form input items (text boxes,
radio buttons, etc.) to capture the user input. Then use the Insert Record
behavior in Dreamweaver to insert the information to the database.

Make sure the permissions on your database are set to be able to "write" to
the database so the values can be inserted.

If that doesn't help you, could you post the code you are using?


--
Nancy Gill
Adobe Community Expert
Author: Dreamweaver 8 e-book for the DMX Zone
Co-Author: Dreamweaver MX: Instant Troubleshooter (August, 2003)
Technical Editor: Dreamweaver CS3: The Missing Manual,
DMX 2004: The Complete Reference, DMX 2004: A Beginner's Guide
Mastering Macromedia Contribute
Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP Web Development

"Hiral_p" <webforumsuser@macromedia.com> wrote in message
news:fke7v9$er6$1@forums.macromedia.com...
> Hello,
> I want to save data from webpage to MS access database. I am using
> dreamweaver MX 2004 developing tool. For server side scripting I am using
> asp
> page but I am not geting any result. And I am calling this asp page using
> HTML
> codes (using "action").
> Please anybody suggest me proper way for this.
>


Hiral_pAuthor
Participant
December 20, 2007
Thanks for the reply....I'will try your suggestion ........But still I will appriciate if you can check my codes......

I am using following codes for webpages,

<form name="form1" action="add_to_database.asp" method="post">

<div align="center">
<table width="80%" border="0">
<td><b>FEEDBACK FORM</b></td>
<tr> <td>Name :</td>
<td><input type="text" name="uname"></td> </tr>
<tr>
<td>Email :</td>
<td> <input type="text" name="email"></td>
</tr>
<tr>
<td>Comments :</td>
<td><textarea name="comments"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="Submit details" name="submit" onClick="validate()" ></td>
</tr>
</table>
</div>
</form>
and using the action and post method I am calling following asp page

<body>
<%
Dim uname, email, comments
Dim Conn
Dim Rs
Dim sql

uname = Request.Form("uname")
email = Request.Form("email")
comments =Request.Form("comments")

Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")

Conn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("users.accdb")

sql= "INSERT into adduser(uName, Email, Comments) values(' " & uname & "', '" & email & "', '" & comments & "')"

Conn.execute sql

Rs.Open sql, Conn

Rs.AddNew
Rs.Fields("Name") = Request.Form("name")
Rs.Fields("Email")=Request.Form("email")
Rs.Fields("Comments") = Request.Form("comments")

Rs.Update
Rs.Close
Set Rs = Nothing
Set Conn = Nothing

%>

</body>


Thanks,