•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 403,519 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,807 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 1033 | Replies: 5 | Solved
![]() |
•
•
Join Date: Aug 2007
Posts: 7
Reputation:
Rep Power: 0
Solved Threads: 0
Hi Guys,
I have written a program in VB 6 wherein I want to delete a particular record from MS Access Database Table. I noticed that the record does not get deleted immediately. Only after I close the recordset it disappears. I have a Delete Command Button in a Form that deletes a particular record. After deletion, when I browse the records in the table I noticed that the record has not been deleted. It is only when I close the Form which closes the recordset to that table and when I reopen the recordset I notice that the record gets deleted then. My code is as follows.
Conn.Execute "DELETE FROM <tablename> WHERE FIELD1 = '" & cmdField1.Text & "'"
where Conn is set to a New Connection. So what I did was close the recordset and then reopen it again soon after the above command is executed as follows.
Rs.Close
Rs.Open "SELECT * FROM <tablename> ORDER BY FIELD1", Conn, , , cmdTable
Please let me know if I am doing this the right way or is there any other method of solving this issue? But I want to use the Connection.Execute command only.
Please help. Thanks.
SPereira
I have written a program in VB 6 wherein I want to delete a particular record from MS Access Database Table. I noticed that the record does not get deleted immediately. Only after I close the recordset it disappears. I have a Delete Command Button in a Form that deletes a particular record. After deletion, when I browse the records in the table I noticed that the record has not been deleted. It is only when I close the Form which closes the recordset to that table and when I reopen the recordset I notice that the record gets deleted then. My code is as follows.
Conn.Execute "DELETE FROM <tablename> WHERE FIELD1 = '" & cmdField1.Text & "'"
where Conn is set to a New Connection. So what I did was close the recordset and then reopen it again soon after the above command is executed as follows.
Rs.Close
Rs.Open "SELECT * FROM <tablename> ORDER BY FIELD1", Conn, , , cmdTable
Please let me know if I am doing this the right way or is there any other method of solving this issue? But I want to use the Connection.Execute command only.
Please help. Thanks.
SPereira
HI,
To Refresh the Recordset you can use the ReQuery which the query executes again to get the proper results.
Shailaja
To Refresh the Recordset you can use the ReQuery which the query executes again to get the proper results.
Shailaja
•
•
•
•
Hi Guys,
I have written a program in VB 6 wherein I want to delete a particular record from MS Access Database Table. I noticed that the record does not get deleted immediately. Only after I close the recordset it disappears. I have a Delete Command Button in a Form that deletes a particular record. After deletion, when I browse the records in the table I noticed that the record has not been deleted. It is only when I close the Form which closes the recordset to that table and when I reopen the recordset I notice that the record gets deleted then. My code is as follows.
Conn.Execute "DELETE FROM <tablename> WHERE FIELD1 = '" & cmdField1.Text & "'"
where Conn is set to a New Connection. So what I did was close the recordset and then reopen it again soon after the above command is executed as follows.
Rs.Close
Rs.Open "SELECT * FROM <tablename> ORDER BY FIELD1", Conn, , , cmdTable
Please let me know if I am doing this the right way or is there any other method of solving this issue? But I want to use the Connection.Execute command only.
Please help. Thanks.
SPereira
•
•
Join Date: Feb 2007
Location: Bangalore,India
Posts: 1,213
Reputation:
Rep Power: 4
Solved Threads: 78
try to use this
vb Syntax (Toggle Plain Text)
conn.begintrans Conn.Execute "DELETE FROM <tablename> WHERE FIELD1 = '" & cmdField1.Text & "'" conn.committrans
Share your Knowledge.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
access age amd avatar backup blue gene chips combo command console daniweb data database development dos dropdownlist economy energy enterprise hardware ibm ibm. news intel ibm it linux medicine memory microsoft module news open source pc prompt ps3 recession red hat registry root russia security server sun supercomputing technology trends tweaks ubuntu windows working x86
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: How do I use matrix functions in UDFs?
- Next Thread: Problem in Trim command



Linear Mode