In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how mshflexgrid linkage database deletion, I hope you have something to gain after reading this article, let's discuss it together!
Application of Mshflexgrid attribute
MSHFlexGrid1.Row returns the currently selected line number
MSHFlexGrid1.TextMatrix (MSHFlexGrid1.Row, 0) represents the value of the first column that returns the specified row
Refresh thought after deletion
1. After the database is deleted, do the query again (not recommended, it consumes a lot of performance)
2. After the database is deleted, delete the specified row directly on the mshflexgrid and use the statement MSHFlexGrid1.RemoveItem MSHFlexGrid1.Row
You can delete the specified row by adding an index value after the RemoveItem method
File list:
Interface:
Source code:
Option ExplicitDim sql As StringDim conn As New ADODB.ConnectionDim rs As ADODB.Recordset
Private Sub Command1_Click () If conn.State = 0 Then conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\ Database3.mdb;Persist Security Info=False" conn.OpenEnd If
Sql = "insert into [users] ([username], [password]) values ('" & Text1.Text & ",'" & Text2.Text & "')"
Set rs = New ADODB.Recordset
Rs.Open sql, conn, adOpenKeyset, adLockBatchOptimistic'MsgBox "input successfully!"
Sql = "select * from users" rs.Open sql, conn, adOpenKeyset, adLockBatchOptimistic
Set MSHFlexGrid1.DataSource = rs
'header MSHFlexGrid1.TextMatrix (0,0) = "unique number" MSHFlexGrid1.TextMatrix (0,1) = "account" MSHFlexGrid1.TextMatrix (0,2) = "password"
End Sub
Private Sub Command2_Click () If conn.State = 0 Then conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\ Database3.mdb;Persist Security Info=False" conn.OpenEnd If
Set rs = New ADODB.Recordsetsql = "select * from users" rs.Open sql, conn, adOpenKeyset, adLockBatchOptimistic
Set MSHFlexGrid1.DataSource = rs
'header MSHFlexGrid1.TextMatrix (0,0) = "unique number" MSHFlexGrid1.TextMatrix (0,1) = "account" MSHFlexGrid1.TextMatrix (0,2) = "password" End Sub
Private Sub Command3_Click ()
If conn.State = 0 Then conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\ Database3.mdb;Persist Security Info=False" conn.OpenEnd If
Set rs = New ADODB.Recordset
Sql = "delete from [users] where [id] =" & MSHFlexGrid1.TextMatrix (MSHFlexGrid1.Row, 0)
Rs.Open sql, conn, adOpenKeyset, adLockBatchOptimistic
Method 1 of 'Call Command2_Click'
'method 2
MSHFlexGrid1.RemoveItem MSHFlexGrid1.Row
End Sub
After reading this article, I believe you have a certain understanding of "how mshflexgrid links database deletion". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for your reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.