Hi François,
Thanks for your help. As you have probably guessed, I am new to SQL Anywhere, but because I have been hitting my head against a brick wall with VFP and data replication I decided to try it.
From what you written, I have been able to rectify my problem. Once again, thanks.
Regards
Doug Johnston
>Hi Doug,
>
>I also use vfp+anywhere... after a period of trial and errors i discovered that Sybase anywhere is an incredible and splendid tool. I have being using both for two years now. Quite an effective and complementary tandem of tools !
>
>I use vfp only for editing, browsing and reporting data. We tap the powerful anywhere server querying data.
>
>However updating information in remote data source is difficult.
>Inserting new records is of course tricky. Your data is away from fox.
>
>There are a couple of way to handle the process. The way i do it :
>
>1) get a connection handle to your data source
>
>2) launch a command to fetch the a new id number.
>Example - for an 'ABC-' prefixed code
>
>SQLEXEC(oHandle,[SELECT CAST(SUBSTR(myCode,4,99)+1 AS INTEGER) FROM myRemoteTable WHERE myCode LIKE 'ABC-%'],[MyCursor])
>
>3) build my new string id - this is a classical vfp string manipulation.
>i have no vfp at hand i understand you can transform this integer into a proper
>code. myString should look like 'ABC-nnnnnnnnnnn'
>
>4) try to insert the record in the remote data source
>
>SQLEXEC(oHandle,[INSERT INTO myRemoteTable (myCode) VALUES (]+;
>myString+[)] )
>
>and possibly loop on the process if the last command fails (the code may have been allocated by a concurrent user)
>
>Hope it helps. Do no hesitate to come back to me with private mail in case you wish more specific information
>
>François
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only