# 依 DAO 方式试试 ...

Posted by 安宝 on May 31, 1999 at 09:38:33:

In Reply to: Re: 救命啊呀!!我快想得摸穿头!! posted by 小v on May 30, 1999 at 22:22:46:

实在不知道你是用哪种方式做的 , 依 DAO 方式试一试 ...

Dim dbs As Database ' Database reference
Dim wsp As Workspace ' Workspace reference
Dim rs as recordset

Set wsp = DBEngine.Workspaces(0)
Set dbs = wsp.OpenDatabase("Data1.mdb")
Set rs = dbs.OpenRecordset("Book1",dbOpenTable)
If rs.RecordCount>0 then
With rs
.Index = "BookName"
.Seek "=", "Word2000"
If Not .NoMatch then
.Edit
.Fields!Price = .Fields!Price*1.1
.Update
End If
End With
End If
rs.CLose
dbs.Close
wsp.Close

Follow Ups: