I have developed a intranet . Using HTML , SQL and ASP . I have created a table with SQL is just fine . And design a form is just looks fine to me . But when I try to insert Data into the SQL I just have the Error . The Error appears when I press submit button . But when i just call it using this url http://10.164.1.86/lala.asp . It produce the massege i want it to produce after inserting the information. Hope you can help . My Code looks this one here .
[HTML] <%
Catergory = Trim(Request.Fo rm("registry") )
If Catergory= "Title" then
Title = Trim(Request.Fo rm("Title"))
Author = Trim(Request.Fo rm("Author"))
ISBN = Trim(Request.Fo rm("ISBN"))
Publisher= Trim (Request.Form(" Publisher"))
Place_of_Public ation= Trim(Request.Fo rm("Place of Publication"))
Year=Trim(Reque st.Form("Year") )
Collation=Trim( Request.Form("C ollation"))
Shelf_Number=Tr im(Request.Form ("Shelf Number"))
If Title <>"" and Author <>"" and ISBN <>"" and Publisher <>"" and Place_of_Public ation <>"" and Year <>"" and Collation <>"" and Shelf_Number<>" " Then
%>
MyStatement = "Insert into Book_files Set Values
Title='"&Title& "',Author='"&Au thor&"', ISBN='"&ISBN&"' ,Publisher='"&P ublisher& "',Place_of_Pub lication='"& PlaceofPublicat ion&"',Year='"& Year&"',Collati on='"& Collation&"',Sh elf_Number='"&S helfNumber&"'"
<%
Set Con = Server.CreateOb ject("ADODB.Con ection")
Con.Open "PROVIDER=SQLOL EDB;DATA SOURCE=master;U ID=sa;PWD=sa;DA TABASE=Book_fil es"
Con.Execute MyStatement
End IF
End IF
%>
<Html>
<Head><Title>In sert Data</Title></Head>
<Body>
<Form Method="POST" action.asp? /registry.html>< Head> <Center> <Font Color="Brown" Size=11 Face="Comic Sans Ms">
Confirmation Page </Font> </Center>
<Body BGColor="Yellow ">
<Br><Br>
<%
Response.Write( " Your Value Has Been Successfully Inserted In The Table!")
%>
</Body>
</Html>
[/HTML]
[HTML] <%
Catergory = Trim(Request.Fo rm("registry") )
If Catergory= "Title" then
Title = Trim(Request.Fo rm("Title"))
Author = Trim(Request.Fo rm("Author"))
ISBN = Trim(Request.Fo rm("ISBN"))
Publisher= Trim (Request.Form(" Publisher"))
Place_of_Public ation= Trim(Request.Fo rm("Place of Publication"))
Year=Trim(Reque st.Form("Year") )
Collation=Trim( Request.Form("C ollation"))
Shelf_Number=Tr im(Request.Form ("Shelf Number"))
If Title <>"" and Author <>"" and ISBN <>"" and Publisher <>"" and Place_of_Public ation <>"" and Year <>"" and Collation <>"" and Shelf_Number<>" " Then
%>
MyStatement = "Insert into Book_files Set Values
Title='"&Title& "',Author='"&Au thor&"', ISBN='"&ISBN&"' ,Publisher='"&P ublisher& "',Place_of_Pub lication='"& PlaceofPublicat ion&"',Year='"& Year&"',Collati on='"& Collation&"',Sh elf_Number='"&S helfNumber&"'"
<%
Set Con = Server.CreateOb ject("ADODB.Con ection")
Con.Open "PROVIDER=SQLOL EDB;DATA SOURCE=master;U ID=sa;PWD=sa;DA TABASE=Book_fil es"
Con.Execute MyStatement
End IF
End IF
%>
<Html>
<Head><Title>In sert Data</Title></Head>
<Body>
<Form Method="POST" action.asp? /registry.html>< Head> <Center> <Font Color="Brown" Size=11 Face="Comic Sans Ms">
Confirmation Page </Font> </Center>
<Body BGColor="Yellow ">
<Br><Br>
<%
Response.Write( " Your Value Has Been Successfully Inserted In The Table!")
%>
</Body>
</Html>
[/HTML]
Comment