| |

VerySource

 Forgot password?
 Register
Search
Author: snakeruru

Vb6 selected row in dbgrid

[Copy link]

1

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-7-7 12:45:01
| Show all posts
It is dbgrid instead of datagrid...
What about two different controls.
Reply

Use magic Report

0

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-7-16 22:45:01
| Show all posts
Private Sub DBGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
Text1.Text = Data1.Recordset.AbsolutePosition + 1
End Sub

Really...
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-30 13:45:01
| Show all posts
I tried, if the data is more than one page, the method of fetching the row value upstairs is not good
Reply

Use magic Report

0

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-8-30 19:30:01
| Show all posts
For recorded rows, the best way is to add automatically numbered fields when designing the database

Text1.Text = ado1.recordset.fields("Auto-numbered fields")

Also, if you want to get the value of the selected record,

Text1.Text = DBGrid1.Columns(0)
Text2.Text = DBGrid1.Columns(1)

Connected to the database, that's it

Text1.Text = ado1.recordset.fields("Fields")

PS: Don't use the old things like DBGrid... how troublesome, there are so many problems
     It is better to use datagrid, if possible, change to other ones....
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list