I have the following code
vb Code:
Do Until i = rs_dao.Fields.Count Do Until rs_dao.EOF If i = 0 Then rs.AddNew (rs.Fields(0).Name), (rs_dao.Fields(0).Value) Else rs.Update (rs.Fields(i).Name), (rs_dao.Fields(i).Value) End If rs.MoveNext rs_dao.MoveNext Loop i = i + 1 rs.MoveFirst rs_dao.MoveFirst Loop
rs - SQL Server recordset
rs_dao - Access recordset
All columns work fine apart from the first one on the rs.AddNew. It's not in order, i.e 1 - 10. But the other rs.Update columns are fine and in order
The rs database is a blank one so the inital row will have to be added through the AddNew function.
Im using SQL Server 2000, I noticed that if I toggle the NULLs on in the SQL table design and then run it works fine. I do it again and it doesn't. Then if I toggle the NULLs off again it'll work perfectly for the first time only.
Any ideas?




Reply With Quote