# ASP : adding to database

**URL:** https://forum.kirupa.com/t/asp-adding-to-database/82726
**Category:** programming
**Created:** [March 12, 2005, 8:22pm UTC](https://forum.kirupa.com/t/asp-adding-to-database/82726 "2005-03-12T20:22:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dinkumrocks](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@dinkumrocks](https://forum.kirupa.com/u/dinkumrocks)
#### Post date: [March 12, 2005, 8:22pm UTC](https://forum.kirupa.com/t/asp-adding-to-database/82726/1 "2005-03-12T20:22:58Z")

</div>

OK, i have a really simple and quick question… well actaully 2

q #1

i have one main file called function.asp that deals will all the database related things. EX. adding a news update… hte from action would be function.asp?method=addnews.

is this a bad thing to do, or is it ok?

Q. #2  
Im making a news updating script, and im running into troubles.

this is what i have…

```auto
 <%
Conn = Server.CreateObject("ADODB.Connection")
lpath = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("main.mdb")
Conn.Open(lpath)
set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "updates", Conn
RS.AddNew
RS("title") = Request.Form("title")
RS("body") = Request.Form("body")
RS("when") = Now()
RS("day") = DatePart("d", Date())
RS("month") = DatePart("m", Date())
RS("year") = DatePart("yyyy", Date())
RS.Update
RS.Close
Set RS = Nothing
Conn.close
set Conn = nothing
Response.Write "sdfgfdsg" 'to see if it works
%>

```

do you see any problems with it? all im getting is 500 errors.

thanks for any help  
-Naaman
