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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating records with ADO

Status
Not open for further replies.

NW

Programmer
Feb 3, 2000
61
GB
How can I update a record in a FoxPro table using ADO?
So that all other users in the network can see latest changes?

Is there a way to find out if a record been changed (after loading the recordset)
before issue an "Update"?

This is my coding to connect to this dbf, Can someone tell me where I need changing please?

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

Private Sub Form_Load()
Dim strCnn, sSQL As String

Set cn = New ADODB.Connection
strCnn = "SourceType=DBF; " & _
"SourceDB=\\data\custdata;" & _
"Driver={Microsoft Visual FoxPro Driver};" & _
"Exclusive=no"
Set cn = New ADODB.Connection
cn.CursorLocation = adUseClient
cn.Open strCnn

sSQL = "SELECT * FROM CUSTdatx "
sSQL = sSQL & " WHERE Len(Trim(ActiveCust))>0"

Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open sSQL, cn, adOpenStatic, adLockOptimistic, adCmdUnknown
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top