Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO controls

Status
Not open for further replies.

Jaked

Instructor
Mar 4, 2002
7
0
0
ZA
I have a table and try to add records in the table by using 2 text boxes and an ADO datacontrol.
I have an empty table
I get an error when trying to add the first record, but when I set up the first record manually it adds records after that.

I use Access 2000 and VB6.
In my table i have a Auto number field.

Can someone help me with a code that will not give me an error because it cannot use the command adodc1.recordset.addnew when there is no records available.

I will appreciate it
 
have u writren rs.movefirst before rs.addnew
then this is an error
because record counter don't have any count to move on
just use this syntax
if rs.recordcount<> 0 then
rs.movefirst
endif
or either remove it and check it out if u have one record
then move to first record
Bye
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top