PDA

View Full Version : Error Message When Saving data using ODBC



dcipher
2013-03-14, 14:51
Hi

I created a Visual FoxPro database and added one remote view from the Lianja Southwind database based on the Orders table using the Lianja ODBC driver. I was able to open and browse the table just fine in VFP but when I added a new record I was unable to save it because I keep getting the following error message "Connectivity Error: Function Sequence Error". The SQL for the view is shown below. Can any one tell me what the problem might be?

I also see another error "Connectivity Error: Restricted data type attribute violation".



SELECT Corders.CORDERID, Corders.ORDERID, Corders.CUSTOMERID,;
Corders.EMPLOYEEID, Corders.ORDERDATE, Corders.REQUIREDDATE,;
Corders.SHIPPEDDATE, Corders.SHIPVIA, Corders.FREIGHT, Corders.SHIPNAME,;
Corders.SHIPADDRESS, Corders.SHIPCITY, Corders.SHIPREGION,;
Corders.SHIPPOSTALCODE, Corders.SHIPCOUNTRY;
FROM ;
southwind.corders Corders

DBSetProp(ThisView,"View","SendUpdates",.T.)
DBSetProp(ThisView,"View","BatchUpdateCount",1)
DBSetProp(ThisView,"View","CompareMemo",.T.)
DBSetProp(ThisView,"View","FetchAsNeeded",.F.)
DBSetProp(ThisView,"View","FetchMemo",.T.)
DBSetProp(ThisView,"View","FetchSize",100)
DBSetProp(ThisView,"View","MaxRecords",-1)
DBSetProp(ThisView,"View","Prepared",.F.)
DBSetProp(ThisView,"View","ShareConnection",.F.)
DBSetProp(ThisView,"View","AllowSimultaneousFetch",.F.)
DBSetProp(ThisView,"View","UpdateType",2)
DBSetProp(ThisView,"View","UseMemoSize",255)
DBSetProp(ThisView,"View","Tables","southwind.corders")
DBSetProp(ThisView,"View","WhereType",1)

DBSetProp(ThisView+".corderid","Field","DataType","C(5)")
DBSetProp(ThisView+".corderid","Field","UpdateName","southwind.corders.CORDERID")
DBSetProp(ThisView+".corderid","Field","KeyField",.T.)
DBSetProp(ThisView+".corderid","Field","Updatable",.T.)

DBSetProp(ThisView+".orderid","Field","DataType","N(10)")
DBSetProp(ThisView+".orderid","Field","UpdateName","southwind.corders.ORDERID")
DBSetProp(ThisView+".orderid","Field","KeyField",.F.)
DBSetProp(ThisView+".orderid","Field","Updatable",.T.)

DBSetProp(ThisView+".customerid","Field","DataType","C(5)")
DBSetProp(ThisView+".customerid","Field","UpdateName","southwind.corders.CUSTOMERID")
DBSetProp(ThisView+".customerid","Field","KeyField",.F.)
DBSetProp(ThisView+".customerid","Field","Updatable",.T.)

DBSetProp(ThisView+".employeeid","Field","DataType","N(10)")
DBSetProp(ThisView+".employeeid","Field","UpdateName","southwind.corders.EMPLOYEEID")
DBSetProp(ThisView+".employeeid","Field","KeyField",.F.)
DBSetProp(ThisView+".employeeid","Field","Updatable",.T.)

DBSetProp(ThisView+".orderdate","Field","DataType","D")
DBSetProp(ThisView+".orderdate","Field","UpdateName","southwind.corders.ORDERDATE")
DBSetProp(ThisView+".orderdate","Field","KeyField",.F.)
DBSetProp(ThisView+".orderdate","Field","Updatable",.T.)

DBSetProp(ThisView+".requireddate","Field","DataType","D")
DBSetProp(ThisView+".requireddate","Field","UpdateName","southwind.corders.REQUIREDDATE")
DBSetProp(ThisView+".requireddate","Field","KeyField",.F.)
DBSetProp(ThisView+".requireddate","Field","Updatable",.T.)

DBSetProp(ThisView+".shippeddate","Field","DataType","D")
DBSetProp(ThisView+".shippeddate","Field","UpdateName","southwind.corders.SHIPPEDDATE")
DBSetProp(ThisView+".shippeddate","Field","KeyField",.F.)
DBSetProp(ThisView+".shippeddate","Field","Updatable",.T.)

DBSetProp(ThisView+".shipvia","Field","DataType","N(10)")
DBSetProp(ThisView+".shipvia","Field","UpdateName","southwind.corders.SHIPVIA")
DBSetProp(ThisView+".shipvia","Field","KeyField",.F.)
DBSetProp(ThisView+".shipvia","Field","Updatable",.T.)

DBSetProp(ThisView+".freight","Field","DataType","N(20,4)")
DBSetProp(ThisView+".freight","Field","UpdateName","southwind.corders.FREIGHT")
DBSetProp(ThisView+".freight","Field","KeyField",.F.)
DBSetProp(ThisView+".freight","Field","Updatable",.T.)

DBSetProp(ThisView+".shipname","Field","DataType","C(40)")
DBSetProp(ThisView+".shipname","Field","UpdateName","southwind.corders.SHIPNAME")
DBSetProp(ThisView+".shipname","Field","KeyField",.F.)
DBSetProp(ThisView+".shipname","Field","Updatable",.T.)

DBSetProp(ThisView+".shipaddress","Field","DataType","C(60)")
DBSetProp(ThisView+".shipaddress","Field","UpdateName","southwind.corders.SHIPADDRESS")
DBSetProp(ThisView+".shipaddress","Field","KeyField",.F.)
DBSetProp(ThisView+".shipaddress","Field","Updatable",.T.)

DBSetProp(ThisView+".shipcity","Field","DataType","C(15)")
DBSetProp(ThisView+".shipcity","Field","UpdateName","southwind.corders.SHIPCITY")
DBSetProp(ThisView+".shipcity","Field","KeyField",.F.)
DBSetProp(ThisView+".shipcity","Field","Updatable",.T.)

DBSetProp(ThisView+".shipregion","Field","DataType","C(15)")
DBSetProp(ThisView+".shipregion","Field","UpdateName","southwind.corders.SHIPREGION")
DBSetProp(ThisView+".shipregion","Field","KeyField",.F.)
DBSetProp(ThisView+".shipregion","Field","Updatable",.T.)

DBSetProp(ThisView+".shippostalcode","Field","DataType","C(10)")
DBSetProp(ThisView+".shippostalcode","Field","UpdateName","southwind.corders.SHIPPOSTALCODE")
DBSetProp(ThisView+".shippostalcode","Field","KeyField",.F.)
DBSetProp(ThisView+".shippostalcode","Field","Updatable",.T.)

DBSetProp(ThisView+".shipcountry","Field","DataType","C(15)")
DBSetProp(ThisView+".shipcountry","Field","UpdateName","southwind.corders.SHIPCOUNTRY")
DBSetProp(ThisView+".shipcountry","Field","KeyField",.F.)
DBSetProp(ThisView+".shipcountry","Field","Updatable",.T.)

yvonne.milne
2013-03-15, 09:24
The "Connectivity Error: Function Sequence Error" is due to the use of the '.' database pointer (southwind.corders.fieldname). This is not being recognised correctly on INSERT statements (it is OK on SELECT). Changing these to '!' (southwind!corders.fieldname) will prevent the error. I have Submitted a Ticket for this.

The "Connectivity Error: Restricted data type attribute violation" is being sent on attempting to update the date fields with bound parameters. This is still under investigation.