Link to home
Start Free TrialLog in
Avatar of poirier_i
poirier_i

asked on

database acces with vb 6.0

on a form, Insert, modify and delete a record on a dbf table with ADODC ( i will apreciate to receive the code to know how to do it!!)
Avatar of poirier_i
poirier_i

ASKER

Adjusted points from 15 to 50
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset

cn.Open "DSN=Visual FoxPro Tables;UID=;PWD=;SourceDB=d:\My Work;SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;"
rs.Open "select * from test", cn

' Add new record
rs.addnew
rs.fields(0)=122
rs.fields(1)="xxx"
rs.update

'Edit record
rs.fields(0)=133
rs.update

'Delete record
rs.delete
rs.update

PS Test.dbf is a table in d:/My Work directory

HTH
ASKER CERTIFIED SOLUTION
Avatar of gfaucher
gfaucher

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial