| |

VerySource

 Forgot password?
 Register
Search
View: 1226|Reply: 11

Emergency help

[Copy link]

1

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-1-8 11:20:01
| Show all posts |Read mode
Why when I read the mdb file and display it in the ListView, there are many rows of data showing only the first column of data, and the subsequent ones are empty, I don't know what is going on, how can the masters solve it? Thank you very much !!!
Reply

Use magic Report

1

Threads

15

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-1-9 18:27:01
| Show all posts
If you look at the number of recordsets obtained by reading the data, first determine whether the number of records is reduced or the number is reduced after being added to the list.
Reply

Use magic Report

1

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-1-9 21:18:01
| Show all posts
Thank you upstairs, the number of records obtained is correct, that is, some of them have only the first item, and all subsequent ones are empty, and all other recordsets are completely displayed. I wonder what happened?
Reply

Use magic Report

1

Threads

15

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-1-19 17:09:01
| Show all posts
Then paste the code into the list to see.
Reply

Use magic Report

0

Threads

25

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

Post time: 2020-1-20 18:54:02
| Show all posts
Is this the data file?
Reply

Use magic Report

1

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 United States

 Author| Post time: 2020-1-21 07:54:02
| Show all posts
Because some columns are integers, I format them as strings for easy display.
while (! recordset.IsEOF ())
{
strTemp.Format ("% d", recordset.m_column2);
strTemp1.Format ("% f", recordset.m_column3);
strTemp2.Format ("% f", recordset.m_column4);
strTemp3.Format ("% f", recordset.m_column5);
strTemp4.Format ("% f", recordset.m_column6);
strTemp5.Format ("% f", recordset.m_column7);

ctl-> InsertItem (i, recordset.m_column1);
ctl-> SetItemText (i, 1, strTemp);
ctl-> SetItemText (i, 2, strTemp1);
ctl-> SetItemText (i, 3, strTemp2);
ctl-> SetItemText (i, 4, strTemp3);
ctl-> SetItemText (i, 5, strTemp4);
ctl-> SetItemText (i, 6, strTemp5);
ctl-> SetItemText (i, 7, recordset.m_column8);
recordset.MoveNext ();
}
Reply

Use magic Report

2

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-21 19:18:01
| Show all posts
Could it be that the properties of the listView are not set properly?
Reply

Use magic Report

1

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-1-22 18:54:01
| Show all posts
The built is a single document based on ListView, the properties should not have much problem!
Reply

Use magic Report

1

Threads

15

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-1-24 19:54:01
| Show all posts
Do you have a sort function? In this case, try this:
int nIndex = ctl-> InsertItem (i, recordset.m_column1);
ctl-> SetItemText (nIndex, 1, strTemp);
ctl-> SetItemText (nIndex, 2, strTemp1);
ctl-> SetItemText (nIndex, 3, strTemp2);
ctl-> SetItemText (nIndex, 4, strTemp3);
ctl-> SetItemText (nIndex, 5, strTemp4);
ctl-> SetItemText (nIndex, 6, strTemp5);
ctl-> SetItemText (nIndex, 7, recordset.m_column8);
Reply

Use magic Report

1

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-4-24 10:30:01
| Show all posts
Thank you very much, the problem is solved !!!
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