I have put the recordset. movelast in and i get the error Error Type:
Microsoft JET Database Engine (0x80040E24)
Rowset does not support fetching backward.
/form/add_to_database.asp, line 77
Here is the rest of my code if it will make any sense! cheers guys
<%
'declare your variables
Dim name, email, mobile, card, pixel
Dim sConnString, connection, sSQL, recordset
' Receiving values from Form, assign the values entered to variables
name = Request.Form("name")
email = Request.Form("email")
mobile =Request.Form("mobile")
card =Request.Form("card")
pixel =Request.Form("pixel")
'declare SQL statement that will query the database
sSQL = "INSERT into users_tbl (name, email, mobile, card, pixel) values ('" & _
name & "', '" & email & "', '" & mobile & "', '" & card & "', '" & pixel & "')"
'define the connection string, specify database
'driver and the location of database
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("Users.mdb")
'create an ADO connection object
Set connection = Server.CreateObject("ADODB.Connection")
'Open the connection to the database
connection.Open(sConnString)
'execute the SQL
connection.execute(sSQL)
response.write ""
' Done. Close the connection object
connection.Close
Set connection = Nothing
%>
<%
'declare SQL statement that will query the database
sSQL="SELECT * FROM Users_tbl"
'create an ADO connection and recordset object
Set connection = Server.CreateObject("ADODB.connection")
Set recordset = Server.CreateObject("ADODB.Recordset")
'define the connection string, specify database
'driver and the location of database
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("Users.mdb")
'Open the connection to the database
Connection.Open sConnString
'Open the recordset object, executing the SQL
Recordset.Open sSQL, Connection
'Looping through the records until the end of the records
Do while Not recordset.eof
Response.Write "Ticket : " & recordset("id") & "<br>"
Response.Write "Name : " & recordset("name") & "<br>"
Response.Write "Email : " & recordset("email") & "<br>"
Response.Write "mobile : " & recordset("mobile") & "<br><br>"
Response.Write "Pixels : " & recordset("pixel") & "<br><br>"
'move on to the next record
recordset.MoveNext
loop
recordset.movelast
'Now close the recordset and the connection object
recordset.Close
Set recordset = Nothing
connection.Close
Set connection = Nothing
%>