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!

Adding records to Remote ODBC view

Status
Not open for further replies.

white605

Technical User
Jan 20, 2003
394
US
vfp9 I have a database with a remote view based on mysql on webserver.
Send sql updates is checked.
I copied the structure of the view to a temp file
Prepared and added records in the temp file
I want to add the records to the remote view and update the mysql table on the server.

Code:
 open database bhp
use content {remote view}
append from contenttmp.dbf  {gives error starting at the first memo field that is empty }
I feel sure i am not approching the insert in the correct way but cannot find an example of how to start.
thanks in advance
wjwjr

This old world keeps spinning round - It's a wonder tall trees ain't layin' down
 
what error do you get? ERROR()? MESSAGE()?

Is there a field rule set up for the view, not allowing empty memos?

Bye, Olaf.
 
Try setting the SQL WHERE clause option to "Key fields only". Most backends don't accept memo fields in the WHERE clause.

Also, make sure the primary key is flagged as updateable. You don't normally want to update a primary key, but, in the case of an insert, if you don't do that, VFP will send a NULL, which the server won't accept.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
The error i get is
Connectivity Error mysql odbc3.51 You have and eror in your sql syntax, check the manual...for the right syntax to use near'fulltext,state,sectionid,mask,....at line 1
fulltext is not the first field in the table and it is not the first memo field in the table either.

Also, i tried checking the key fields only in the view designer and it did not work.

Default setting of using sql insert was checked..i will try using update and delete checked also
thanks
wjwjr

This old world keeps spinning round - It's a wonder tall trees ain't layin' down
 
What worked for me was
Code:
open database bhp
INSERT INTO bhptoday!content (title,alias,introtext,state,sectionid,catid) ;
	VALUES ("test title","test-title","this is the intro",1,2,2)
=tableupdate(.t.)

This is for stuffing articles into Joomla Articles
wjwjr

This old world keeps spinning round - It's a wonder tall trees ain't layin' down
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top