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!

conversionproblem from Access 97 to XP

Status
Not open for further replies.

AxeaXeaxE

Programmer
Apr 22, 2002
21
0
0
NL
I wrote the following function in 97:

------------------------------------------------------------
Dim db As database
Dim rst As Recordset
Dim query As String

Let query = "SELECT * FROM EXPORT2 WHERE chauffeur = " & Me.KzeI.Column(0) & " and Naam = " & Me.KzeI.Column(1)

Set db = CurrentDb()
Set rst = de.openrecordset(query)

rst.MoveFirst
Do Until rst.EOF
rst.edit
rst![vinkje] = True
rst.Update
rst.Close
Loop
------------------------------------------------------------

But in XP the set db as database and rst.edit aren't available.

I think I fixed the first part, but the .edit is still a mistery, can anyone help me with this. Either give me the current function for .edit or rewrite the whole function.

This is what I've got so far:

Dim db As Connection
Dim rst As Recordset
Dim query As String

Let query = "SELECT * from EXPORT2"
Set db = CurrentProject.Connection
Set rst = db.openrecordset(query)

rst.MoveFirst
Do Until rst.EOF
rst.edit
rst![vinkje] = True
rst.Update
rst.Close
Loop
 
Two possibilities: Your recordset, as defined, may not be editable. Try specifying the query as a dbOpenDynaset on the 'Set rst' line. This link shows syntax on opening and editing ADO recordsets:


Also, you may need to make rst![vinkje] = True -->> rst![vinkje].value = True - - - -

Bry
 
Check ur reference library also... I think u need to have DAO 3.5 as opposed to 2.5/3.5 Compatible... ? htwh Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents - Please Show Your Support...
 
It indeed doesn't recognise the DAO.database. I downloaded DAO 3.6 and installed it, but don't really know how it works, because he still doesn't recognise the DAO.database...?
 
Sorry, I don't have any details... I remember reading an article on one of the Access Forums, perhaps a one other than this site. It detailed out some gotcha's related to XP & Access. Try searching on Library Reference.. ? htwh Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents - Please Show Your Support...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top