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!!)
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;Exclus ive=No;Bac kgroundFet ch=Yes;Col late=Machi ne;Null=Ye s;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
Dim rs As New ADODB.Recordset
cn.Open "DSN=Visual FoxPro Tables;UID=;PWD=;SourceDB=
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER