Append Data in Visual Foxpro Table

  • Thread starter Thread starter gurusamy sekar via AccessMonster.com
  • Start date Start date
G

gurusamy sekar via AccessMonster.com

Hi All..
I want to create Field in Foxpro Thru VBA Code.then i want to add the
value(data) to that field.i have my code as ..
but i got error as
"ODBC does not support theis requested properties."
the error was in rs.Open statement.If anybody plz debug the error.
thanks in advance.


my code is as..

Call createfield
Dim db As New ADODB.Connection
Dim rs As ADODB.Recordset
If db.State = 1 Then db.Close
db.Open "Driver={Microsoft Visual Foxpro Driver};sourcetype=DBF;sourceDB=D:\
tab;exclusive=No;collate=Machine"
Set rs = New ADODB.Recordset
rs.CursorType = adOpenDynamic
rs.LockType = adLockOptimistic
rs.Open "pole", db, , , adCmdTable



Sub createfield()
Dim rs As New ADODB.Recordset
Dim con As New ADODB.Connection
If con.State = 1 Then con.Close
On Error Resume Next
con.Open "Driver={Microsoft Visual Foxpro Driver}
;sourcetype=DBF;sourceDB=D:\tab;exclusive=No;collate=Machine"
con.Execute ("alter table pole add rotation c(5)")
'Errhandler:
'con.Close
End Sub
 
Back
Top