>I have only played with the OLD-DB provider and I was able to update data. Nevertheless, I've heard that the OLE-DB provider is extremely sensitive. For example, if the value to update is larger than the field size the OLE-DB provider will choke (rather than truncating the value or telling you that the value is too big for the field.)
Hector;
To prevent this type of problem I use code like this for an ASP page:
<input style="HEIGHT: 20px;
LEFT: 760px;
POSITION: absolute;
TOP: 5px;
WIDTH: 70px;
FONT-SIZE: 9pt;"
id=txtLogNumber
name=txtLogNumber
value="<%=oRS("lognumber")%>"
readonly
maxlength="<%=oRS.fields("lognumber").definedsize%>">
The same concept can be applied to other languages also.
Tom
>
>>Does anyone know if the foxpro OLE DB driver supports updating Foxpro databases?
>>
>>The following code uses ADO to connect and attempt to edit a simple foxpro table.
>>If I use the ODBC connection string, it works. If I use the OLE DB connection string if causes an error something like
>>
>>"object or provider is not capable of performing the required operation"
>>
>>I have also being playing with visual studio .net, and get a similar problem. I can connect and retrieve data happily using the oledbdataadapter object, but updating, inserting or deleting foxpro tables fails every time.
>>
>>the code listing (please change the file paths and table names if you want to try it)
>>
>>
>>&&&here is the ole db connection string
>>constr='Provider=VFPOLEDB.1;Data Source=C:\FXCLIENT\CSDATA\CSDATA.DBC;Mode=Share Deny None;Extended Properties="";User ID="";Password="";Mask Password=False;Cache Authentication=False;Encrypt Password=False;Collating Sequence=MACHINE'
>>
>>&&&here is the odbc connection string
>>constr='DSN=testpms;UID=;PWD=;SourceDB=C:\fxclient\CSdata\csdata.dbc;SourceType=DBC;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;'
>>
>>
>>&&here is the odbc connection string
>>
>>
>>
>>con=Createobject("adodb.connection")
>>
>>con.connectionstring=constr
>>con.Open
>>Sqlstr="select client,surname from clients where client='A0001'"
>>rs=Createobject("adodb.recordset")
>>rs.cursortype=2
>>rs.locktype=3
>>rs.Open(Sqlstr,con)
>>
>>If Not rs.Eof
>> Messagebox("record found")
>> rs.Fields("surname").Value="test update"
>> rs.Update
>>Else
>> Messagebox("record not found")
>>Endif
>>rs.close
>>con.Close
>>RELEASE rs
>>RELEASE con