Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
access db 2003 has an upper limit when i want the last record it go to number 610 and the last record is 639 no error in the application the record has six columns ,please any idea?????

i use this code
C#
this.BindingContext[dataset3, "received"].Position = this.BindingContext[dataset3, "received"].Count - 1;

i also tried to use this
C#
this.BindingContext[dataset3, "received"].Position = 638; but no change 

the application worked for 2 months before this error , another copy for the same application worked in the same pc it worked correctly for one day then the same error appears?

virus or activation or what? ((visual studio 2010 ))
Posted
Updated 15-Mar-13 5:49am
v2
Comments
Suvabrata Roy 15-Mar-13 1:27am    
Please provide the whole code block...
CHill60 15-Mar-13 11:56am    
Have you tried using the Repair tool in Access to see if the database itself is corrupt?
ameer.ahmd 15-Mar-13 13:18pm    
thanks for replay this is the function i use to display the last record ,its archive application
so i need to know the last record that i entered yesterday
after i save the record i use this to take its id so i can use it as a name for the page i get by
the scanner

static string str = "provider=microsoft.jet.oledb.4.0;data source=" + Application.StartupPath + "\\scti.mdb";
OleDbConnection con = new OleDbConnection(str);
OleDbDataAdapter dataadapter3;
DataSet dataset3 = new DataSet();
<pre lang="cs">private void get_idtext()
{
textBox8.DataBindings.Clear();
string sid = "select idnum from received";
dataadapter3 = new OleDbDataAdapter(sid, con);
try
{
con.Open();
dataadapter3.Fill(dataset3, "received");
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
this.BindingContext[dataset3, "received"].Position = this.BindingContext[dataset3, "received"].Count - 1;
textBox8.DataBindings.Add("text", dataset3, "received.idnum");
}</pre>
ZurdoDev 15-Mar-13 14:13pm    
This isn't clear. Is it possible you are missing some records? In other words your autonumber field might go to 639 but some records were deleted so now there are only 610 records.
ameer.ahmd 15-Mar-13 15:11pm    
yes there are many deleted records but the code (as i understand)take the existing records from the table and put it in dataset3 and go to the last record ,also it was work correctly for tow months
when i open the db by access i found about 29 records after 610 so i deleted the record 610
the result was that the application considered the 609 as the last record?????
is there any relation between the autonumber and the Count?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900