473,396 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help - Deleting a record in a database

I have a page that list all records in an access table. I would like to add
a delete record function to the list to delete selected records. Here is my
current code:

************************************************** *******
<%
Dim strDB, con
Dim rs

strDB = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
Server.MapPath("ques_comm.mdb") & ";"

Set con = CreateObject("ADODB.Connection")
con.Open strDB
Set rs = CreateObject("ADODB.Recordset")
rs.CursorLocation =3

rs.Open "select * from questions ORDER BY usernumber DESC", con
WHILE NOT rs.EOF %>
<TR>
<TD width=25 rowspan="3" align=left valign="middle"
bgColor=#000000><div align="center"><span
class="style1"><%=rs("usernumber")%>&nbsp;</span></div></td>

<TD align=left height=25 bgColor=#e7e7de width=103><strong><font
size="2">Name:</font></strong></td>
<td width="697" bgColor=#e7e7de><font
size="2"><%=rs("UserName")%>&nbsp;</font></td> <td width="3"></TD>
</TR>
<TR>
<TD align=left height=25 bgColor=#e7e7de width=103><strong><font
size="2">Time
Submitted:</font></strong></td>
<td bgColor=#e7e7de><font
size="2"><%=rs("SubmitDT")%>&nbsp;&nbsp;<%=rs("Sub mitTF")%>&nbsp;</font></TD>
</TR>
<TR>
<TD align=left height=25 bgColor=#e7e7de width=103><strong><font
size="2">Question:</font></strong></td>
<td bgColor=#e7e7de><font size="2"><%=rs("Comments")%>&nbsp;</font></TD>
</TR>
<TR>
<TD align=left colspn=2>&nbsp;</TD>
<TD align=left height=25 colspn=2>&nbsp;&nbsp;</TD>
</TR>
<% rs.MoveNext
wend
con.Close
Set con = Nothing
Set rs = Nothing
%>

************************************************** ******

Thanks in advance.
Rich
Aug 15 '05 #1
2 1142
Ri**@NeedsHelp.com wrote:
I have a page that list all records in an access table. I would like to
add a delete record function to the list to delete selected records. Here
is my current code


That looks like ASP+VBScript. This is a JavaScript newsgroup - not the best
place to get answers for that type of question.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Aug 15 '05 #2
Thanks, I moved it to VBScript.
Aug 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RAllsopp | last post by:
I am having trouble deleting a record from a subform. I actually have a main form with two subforms, one dependent on the record selected in the other. The user selects a record to view on the...
3
by: Chris Thunell | last post by:
I am trying to delete all the records in a table, but I keep getting a system.data.dbconcurrency exception. Is there an easy was to delete all the records in a sql table? Here is my code... i...
0
by: Raphael | last post by:
Hi Everyone, I need some help in Editing and Deleting a record from a listview. Example- I have a list view that is populated from an Access Database, I will like users to click on any record in...
8
by: Kissi Asiedu | last post by:
I have a database in a shared folder, however users with permission can only access the database in read-only format. What have I done wrong? This is on Win Xp Pro and Access 2003. Please help. ...
6
by: keeps21 | last post by:
I'm having a bit of trouble creating a page to delete a story from the content table in my database. I have checked my DELETE query directly in phpmyadmin and it is working fine. I am echoing...
3
by: hathan | last post by:
Can anyone explain why this code doesnt delete from the database. Some times it works and some times it errors i am confused. Private Sub DeleteBtn_Click(ByVal sender As System.Object, ByVal e As...
1
by: Coll | last post by:
I'm working on a database that someone else created. I have a form - frm_main that is based on a query that is based on two tables. The join is such that the first table tbl_JCN has all records...
0
by: gershwyn | last post by:
In Access 2007, I am trying to add a button to my sata entry split form that will delete the current record, after prompting, but I am running into a bizarre issue. Here is the relevant code....
0
by: srgrector | last post by:
Help? with Coding database modification script using a webform & frames... I will have an Amazon book database that is updated regularly, say weekly. I need a program/script that I can run in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.