Hey all! need some help editing this script. The problem i keep running into is that i do not know how to change the insert into statement to insert the USER_ID and two other variables called path1 and path2. I keep getting syntax errors when i try to change it my self. Also the USER_ID which is coming from a cookie is not working well either. It tells me that its not declared when i put it into the insert into statement. Im using Windows XP with IIS 5.1. The page is a ASPX
Thanks!
Thanks!
Code:
<%@ Page Language=VB Debug=true %>
<%
Dim USER_ID
USER_ID = request.cookies("USER_ID").value%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OLEDB" %>
<script runat=server>
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
Dim DBConn as OleDbConnection
Dim DBAdd As New OleDbCommand
DBConn = New OleDbConnection( _
"PROVIDER=Microsoft.Jet.OLEDB.4.0;" _
& "DATA SOURCE=" _
& Server.MapPath("DB/db1.mdb;"))
DBAdd.CommandText = "Insert Into Employee (" _
& "LastName, FirstName ) values (" _
& "'" & Replace(txtLastName.Text, "'", "''") _
& "', " _
& "'" & Replace(txtFirstName.Text, "'", "''") _
& "')"
DBAdd.Connection = DBConn
DBAdd.Connection.Open
DBAdd.ExecuteNonQuery()
End Sub
</SCRIPT>
Comment