Database add record

L

L Scal

My application requires that I accept form data from (angel.com) another
site using POST method to add records to an Access db. I've been having
trouble getting information from them, but I think I've grasped the concept,
and just need a script that adds or inserts a record. I'm trying to test it
on my server first so I know it works, but so far it does not.

The form page is http://erecognitions.com/angeltest.asp. It posts the data
to the following file named angel_insert.asp:

<!--#INCLUDE VIRTUAL="/include/connect.inc"-->

<%
DIM objRS
Set objRS = Server.Create.Object("ADODB.Recordset")
objRS.Open "angel", objConn, , adLockOptimistic,
adCmdTable

objRS.AddNew
ObjRS("CallerID") = Request.Form("CallerID")
ObjRS("AngelNumber") = Request.Form("AngelNumber")
ObjRS("Internet") = Request.Form("Internet")
ObjRS("Marital") = Request.Form("Marital")
ObjRS("Nice") = Request.Form("Nice")
objRS.Update
%>

<%
objRS.Close
Set objRS = Nothing
objCONN.Close
Set objCONN = Nothing
%>

The connect include file is:

<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=A4785_angel"
'DSN name assigned by host
objConn.Open
%>

I got the code for these from internet code sources. Can anyone tell me why
this won't work?

Thanks
LScal
 
J

Jim Buyens

There are too many possible problems to describe them all.
Therefore, please post the exact error messge you're
receiving.

Or, if you prefer a fresh start, browse:

Saving Form Data in a Database
http://www.interlacken.com/winnt/tips/tipshow.aspx?tip=44

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
L

L Scal

Jim and all
Thanks for the help. I've been trying to make this work for about 10 days
now.
When I test my stuff on my own server (not in the actual application), I get
an HTTP 500 Internal server error response.
I took your advice and went to the link. I used the code only changing
things to suit my needs, as best I could. Like the mappath, table, db
fields and form fields. I'm getting a 500 error with that page, too.
Should I post that code?
Again, any help would be very much appreciated.

LScal
"A sharp stick in the eye would less painful"
 
J

Jim Buyens

"HTTP 500 Internal server error" is still a very generic response. Are
you sure there isn't a most descriptive message somewhere?

One thing you can try to get a better message is:

1. In IE, choose Internet Options from the Tools menu.
2. Click the Advanced tab.
3. Under Browsing, uncheck Show Friendly HTTP Error Messages.
4. Click OK, then recreate the error.

If you can't find a better message, then post the entire code for the
Web page (making any passwords or other sensitive data).

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
L

L Scal

That worked well. I was able to figure out what I did wrong with your code,
and now the page itself works great. I directed the angel.com voice
software to the url and tested using their resource, but no records were
added to the db. I tried it with and without the HTML since there's no
actual page to view. If they're sending form data using the POST method as
they say they are this should work, yes?

Thanks again.
LScal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top