Hi, guys. How are you?
Well, I succeed showing database on the Internet.
I created database called guestbook.mdb. It was great.
Then I tried to adding new data using server-side scripting.
I've been trying to this since this morning. But not yet.
I am feeling like being deep problem.
So please help me.
First of all, I created file called 1connect2.asp. It is actually to connect to database. Then created html file to enter some new data. It is a html form. Then I coded another asp file to add data. Whole process is consist of three different files.
Problem is:
When I submit new data via html form, some reason, error messages ocuppied whole screen.
My school ues Novell as local server. What I saw is:
quote:
HTTP Error
Status : 502 Bad Gateway
Description : Origin server is returning status code 500
Note : If necessary, please contact your Systems Administrator for resolution.
Hmm.....I succeed showing my database so that I assume something wrong with another asp file.
The code is:
code:
<%
Dim adoCon
Dim rsAddComments
Dim strSQL
Set adoCon="Server.CreateObject("ADODB.Connection")
adoCon.Provider="Microsoft.Jet.OLEDB.4.0"
adoCon.Open(Server.Mappath("\samurai13\guestbook.mdb"))
set rsAddComments=Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblComments.Name, tblComments.Comments FROM tblComments;"
rsAddComments.CursorType=2
rsAddComments.LockType=3
rsAddComments.Open strSQL, adoCon
rsAddComments.AddNew
rsAddComments.Fields("Name")=Request.Form("name")
rsAddComments.Fields("Comments")=Request.Form("comments")
rsAddComments.Update
rsAddComments.Close
Set rsAddComments=Nothing
Set adoCon=Nothing
Response.Redirect "1connect2.asp"
%>
Thanks for reading this.
Help please!
Hiroki Kozai