|
-
Feb 23rd, 2007, 04:55 AM
#1
Thread Starter
Hyperactive Member
[02/03] How to delete a full row ms access
Hi People
Basically I want to be able to specify a full row of data to be deleted in a ms access db, how do I do this?
Learning C♯
Data Binding & Bound Controls - Objects and wizards will never be as intelligent as you, do it yourself! (Unless your Pro)
-
Feb 23rd, 2007, 04:59 AM
#2
Re: [02/03] How to delete a full row ms access
Execute a sql delete statement with a where clause to identify which record to delete.
"DELETE Table1.* FROM Table1 WHERE Field1 = 'Something';"
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 23rd, 2007, 06:15 AM
#3
Thread Starter
Hyperactive Member
Re: [02/03] How to delete a full row ms access
Hi
Thanks for your reply, however I cannot think of a method to delete a particular row, as data will be added and deleted, below is the coding.
p.s. the info entered into the input box, isnt saving to the DB, if anyone has nay ideas?
VB Code:
If x1.Checked Then
inputdata(0) = InputBox("How did you solve this problem")
'storing text
Try
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=C:\PermenantDB.mdb;")
cn.Open()
str = "INSERT INTO Table1 (Column7) VALUES (@Column7)"
cmd = New OleDbCommand(str, cn)
'##### name
cmd.Parameters.Add("@Column7", OleDbType.VarChar)
cmd.Parameters("@Column7").Value = (inputdata(0)) 'not saving data?
Catch ex As Exception
'Display the error message in a message box then clear the error
MsgBox(ex.Message, MsgBoxStyle.OKOnly)
Err.Clear()
End Try
cn.Close()
'only removes records from list boxes, not the database
lstid.Items.RemoveAt(1)
lstdate.Items.RemoveAt(1)
lstname.Items.RemoveAt(1)
lstdate.Items.RemoveAt(1)
lstproblem.Items.RemoveAt(1)
lstproblemdescription.Items.RemoveAt(1)
'then remove row 1 from database
End If
Learning C♯
Data Binding & Bound Controls - Objects and wizards will never be as intelligent as you, do it yourself! (Unless your Pro)
-
Feb 23rd, 2007, 08:15 AM
#4
Thread Starter
Hyperactive Member
Re: [02/03] How to delete a full row ms access
If anyone could even attempt to solve why the data entered into the input message box isnt saving to the database, I would really appriciate it.
Learning C♯
Data Binding & Bound Controls - Objects and wizards will never be as intelligent as you, do it yourself! (Unless your Pro)
-
Feb 23rd, 2007, 10:50 AM
#5
Thread Starter
Hyperactive Member
Re: [02/03] How to delete a full row ms access
Still looking at that input message, I have even used a textbox to replaced it as a test, but it still doesnt work. My code is identical to other code which works perfectly.
Learning C♯
Data Binding & Bound Controls - Objects and wizards will never be as intelligent as you, do it yourself! (Unless your Pro)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|