用ADO吧!这是我的一段代码,数据库为ACCESS2000Public Sub AddNew()
Dim DataPath As String
Dim conn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
Dim Ex_time As String
Debug.Assert DataPath <> ""
NotfExist = True
DataPath = App.Path + "\180Record.mdb"
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DataPath & ";Mode=ReadWrite;Persist Security Info=False"
conn.Open
Set rs = New ADODB.Recordset
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
rs.CursorLocation = adUseClient
rs.Open "180_Contxt", conn, , , adCmdTable
Ex_time = Trim(InputBox("本联系单处理时限为:"))
    If Not rs.BOF Then
    rs.MoveFirst
    Do While Not rs.EOF
        If (rs!Name = fileN) Then
            NotfExist = False
            If Ex_time <> "" Then
                rs!ex_date = DateAdd("d", Ex_time, rs!i_date)
                rs.Update
            End If
        End If
    rs.MoveNext
    Loop
    End If
    If NotfExist Then
    rs.AddNew
    rs!Name = fileN
    rs!i_date = Date
    If Ex_time <> "" Then
    rs!ex_date = DateAdd("d", Ex_time, rs!i_date)
    End If
    rs!cTime = Time
    rs!Is_hf = False
    rs.Update
    End If
    rs.Close
    conn.Close
End Sub

解决方案 »

  1.   

    用ADO,必需是2。1以上的版本
      

  2.   

    vb6.0不支持access97以上的版本。你可以将数据库转为97格式。
    也可以用DAO 3.5,ADO 2.5(sp5中有,性能比VB自带的2.0好多了),JET 4.0
    odbc最为通用了。
      

  3.   

    谁说VB6不支持ACCESS97以上版本?我就用ADO编写过访问ACCESS2000的程序。用JETOLEDB4。0提供者就可以了。
      

  4.   

    安装sp4就解决了 
    jet 4.0 can be use in access97
      

  5.   

    jet 4.0 can be used in access 2000