473,790 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=Micro soft.Jet.OLEDB. 4.0; Data Source=" &
Server.MapPath( "ques_comm.mdb" ) & ";"

Set con = CreateObject("A DODB.Connection ")
con.Open strDB
Set rs = CreateObject("A DODB.Recordset" )
rs.CursorLocati on =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("usernumb er")%>&nbsp;</span></div></td>

<TD align=left height=25 bgColor=#e7e7de width=103><stro ng><font
size="2">Name:</font></strong></td>
<td width="697" bgColor=#e7e7de ><font
size="2"><%=rs( "UserName")%>&n bsp;</font></td> <td width="3"></TD>
</TR>
<TR>
<TD align=left height=25 bgColor=#e7e7de width=103><stro ng><font
size="2">Time
Submitted:</font></strong></td>
<td bgColor=#e7e7de ><font
size="2"><%=rs( "SubmitDT")%>&n bsp;&nbsp;<%=rs ("SubmitTF")%>& nbsp;</font></TD>
</TR>
<TR>
<TD align=left height=25 bgColor=#e7e7de width=103><stro ng><font
size="2">Questi on:</font></strong></td>
<td bgColor=#e7e7de ><font size="2"><%=rs( "Comments")%>&n bsp;</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 1159
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
1604
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 main form and then can add/edit info on the first subform, which then allows you to enter related info on the second subform. When I try to delete a record from the first subform (and cascade all related records from the second subform), the...
3
3276
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 get the error on the dataadapter.update: MessageBox.Show(Me.DataSet11.tblPreReqWorking.Rows.Count) 'get rid of any records in memory Me.DataSet11.tblPreReqWorking.Clear() Me.daPreReqWorking.SelectCommand.CommandText = "Select JobNo, ReqNo, SeqNo
0
1540
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 the listview and be able to delete or editing record in that list. Please help Ralph
8
1896
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. Thanks.
6
1804
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 the query to check that it comes out as expected and it looks fine. The problem seems to be that when my code is run the record never gets deleted. Meaning that mysql_affected_rows() is always -1 and therefore an error message - 'Could not...
3
1201
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 System.EventArgs) Handles DeleteBtn.Click Dim connStr As String = "Provider = Microsoft.Jet.OLEDB.4.0;" & _ "Data Source = G2G.mdb" Dim oDataTable As New DataTable Dim squlStr As String = "SELECT * From Staff" Dim...
1
1730
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 included in the query, but the second table tbl_SOC only has matching records displayed. On the form (frm_main), there is a combo box - you can make a selection and the form filters to display that record. There is also a delete record button. When...
0
2250
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. Pressing the button triggers the btnDelete_Click() subroutine, which calls DeleteRecord() which in turn can call MoveLine(). Private Sub btnDelete_Click() L = txtLine.Value If Form.NewRecord Then 'The current record has never been saved, so...
0
1303
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 IExplorer (as a page, or on a page) that will allow me to review any records that the category "Include?" lists as "Undecided"; assign the record a "Yes" or "No" in place of the "Undecided" and then update the database. I only want to review undecided...
0
9512
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10200
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10145
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9021
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7530
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4094
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.