i havent been using access for very long and was wondering if anyone could help with this page.
I have created a form and the database, but now need help with the actual on submit place the info into the relevant profile table in access.
see below: (i know this would be simple for most developers but understand that i have only been at asp for a month and a half)
any help would be appreciated.....
<%@ Language=VBScript %>
<%OPTION EXPLICIT
DIM strConnectionString
DIM CONN
DIM RSmovieDB
DIM strSQL
'Define the OLE DB connection string.
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:databasemovieDB.mdb"
'Instantiate the Connection object and open a database connection.
SET CONN = Server.CreateObject("ADODB.Connection"
SET RSmovieDB = server.CreateObject("ADODB.recordset"
CONN.Open strConnectionString '= "DSN=movieDB"
'CONN.Open "DBQ=C:databasemovieDB.mdb;DRIVER={MS Access (movieDB.mdb)}"
'Define SQL SELECT statement.
strSQL = "Select * from details"
If Request("Action" = "VALIDATE" then
strName = Request("txtName"
Response.Write "[" & txtName & "]"
'Use the Execute method to issue a SQL query to database.
RSmovieDB.Open strSQL,cnn
strSql = "Insert into details (Name , Surname , e-mail , contact no ) Values ('txtName','txtSurname','txtCo ntact No','txtE-Mail'"
CONN.Execute strSQL
'close everything
rsmovieDB.Close
CONN.Close
end if
set rsmovieDB = nothing
set CONN = nothing
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY background=images/cssq1.jpg>
<DIV align=center> </DIV>
<DIV align=center> </DIV>
<DIV align=center> </DIV>
<DIV align=center> </DIV>
<H3 align=center><FONT color=darkblue><U>PLEASE COMPLETE THE
FOLLOWING</U></FONT></H3>
<DIV align=center style="BORDER-BOTTOM-COLOR: green; BORDER-LEFT-COLOR: greenyellow; BORDER-RIGHT-COLOR: green; BORDER-TOP-COLOR: greenyellow" >
<FORM id=form1 name=form1 Method="post" action="movie-db.asp">
<INPUT type="hidden" id=Action name=Action value="VALIDATE">
<TABLE id=TABLE1 border=0 cellPadding=1 cellSpacing=1 width="75%" style="HEIGHT: 119px; WIDTH: 272px">
<TR>
<TD><STRONG><FONT face=Arial size=2>Name :</FONT></STRONG></TD>
<TD>
<INPUT id=txtName name=txtName style="HEIGHT: 22px; LEFT: 1px; TOP: 2px; WIDTH: 181px"
>
</TD></TR>
<TR>
<TD><STRONG><FONT face=Arial size=2>Surname :</FONT></STRONG></TD>
<TD>
<INPUT id=txtSurname name=txtSurname style="HEIGHT: 22px; LEFT: 1px; TOP: 2px; WIDTH: 181px"
>
</TD></TR>
<TR>
<TD><STRONG><FONT face=Arial size=2>Contact No :</FONT></STRONG></TD>
<TD>
<INPUT id="txtContact No" name="txtContact No" style="HEIGHT: 22px; WIDTH: 181px">
</TD></TR>
<TR>
<TD>
<P><FONT face=Arial size=2><STRONG>E-Mail :</STRONG></FONT></P></TD>
<TD>
<INPUT id=txtE-Mail name=txtE-Mail style="HEIGHT: 22px; LEFT: 1px; TOP: 2px; WIDTH: 181px"
>
</TD></TR>
<TR>
<TD>
</TD><TD>
<P align=right>
<INPUT id=submit1 name=submit1 type="submit" value="Submit" style="BACKGROUND-COLOR: darkcyan; BORDER-BOTTOM-COLOR: darkblue; BORDER-BOTTOM-STYLE: outset; BORDER-LEFT-COLOR: darkcyan; BORDER-LEFT-STYLE: outset; BORDER-RIGHT-COLOR: darkblue; BORDER-RIGHT-STYLE: outset; BORDER-TOP: darkcyan thin outset; HEIGHT: 24px; WIDTH: 55px">
<INPUT type="reset" value="Clear Fields" id=reset2 name=reset2 style="BACKGROUND-COLOR: darkcyan; BORDER-BOTTOM-COLOR: darkblue; BORDER-LEFT-COLOR: darkcyan; BORDER-RIGHT-COLOR: darkblue; BORDER-TOP-COLOR: darkcyan; HEIGHT: 24px; WIDTH: 83px">
</P>
</TD></TR>
</TABLE>
</FORM>
</DIV>
</BODY>
</HTML>