×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

No update tables are specified.
2

No update tables are specified.

No update tables are specified.

(OP)
I have built a Remote View into a SQL Server data table.

I used the following code to build the view:

CODE

OPEN DATABASE "TS ALAF"
CREATE SQL VIEW "ALAF_Mod1" REMOTE CONNECTION Touchstar SHARE AS ;
   SELECT ContactID,;
   ProjectID,;
   Call_Date,;
   APPL,;
   CRC,;
   Cust1Type,;
   Cust1Status,;
   Cust1Policy,;
   Cust1ActionDate,;
   Cust1ReqStatus,;
   Cust1DeliveryReq,;
   Cust1NotTaking,;
   Cust1Notes,;
   Agent_No,;
   agent_name,;
   AgentPhone;
   FROM alaf_leads
DBSETPROP('ALAF_Mod1','view','tables','dbo.ALAF_Leads')
CLOSE DATABASE

* --- Now I Set The View Cursor Properties to make it Updatable ---
OPEN DATABASE "TS ALAF"
USE ALAF_Mod1 IN 0
SELECT ALAF_Mod1
* --- Get List Of Field Names ---
mnFldCnt = AFIELDS(aryFields)
USE

* --- I do this 15 times for 15 separate views like above ---
FOR ViewCntr = 1 TO 15
   mcViewName = "ALAF_Mod" + ALLTRIM(STR(ViewCntr))
   mcPolicyFld = "Cust" + ALLTRIM(STR(ViewCntr)) + "Policy"

   SET DATABASE TO "TS ALAF"

   * --- Define Key Fields ---
   DBSETPROP(mcViewName+".ProjectID",'Field','KeyField',.T.)
   DBSETPROP(mcViewName + "." + mcPolicyFld,'Field','KeyField',.T.)

   * --- Make Each Field Updatable ---
   FOR I = 1 TO mnFldCnt
      mcFldName = aryFields(I,1)
      IF UPPER(LEFT(mcFldName,5)) = "CUST1"
         mcFldName = "Cust" + ALLTRIM(STR(ViewCntr)) + SUBSTR(mcFldName,6)
      ENDIF
      DBSETPROP(mcViewName+"."+mcFldName, 'Field','UpDatable',.T.)
   ENDFOR

   * --- Set Final Update Property ---
   DBSETPROP(mcViewName,'View','SendUpdates',.T.)
ENDFOR

However when I USE the View ALAF_Mod1 and attempt to do a REPLACE <whatever> I get an error message:
  No update tables are specified. Use the Tables property of the cursor.

I have no clue as to why these views are not allowing me to update them.  I must have missed something.

Your advice would be greatly welcome.

Thanks,
JRB-Bldr

RE: No update tables are specified.

(OP)
Two added detail to the above posting.

The application is written in VFP 7

And, based on another posting found on the net, this might be somehow pertinent.

Someone else mentioned getting this error when accessing a Memo field.

One of the SQL Server table fields is not a Memo field, but it is 200 characters long.

Thanks,
JRB-Bldr

RE: No update tables are specified.

A couple of points:

- Have you tried opening the remote view in the View Designer? That will tell you at a glance if you have set the various properties correctly.

- Re the memo field: I don't think this is relevant to your problem but is the 200-char field by any chance a double-byte or Unicode field (for example, is it an NCHAR or NVARCHAR)? If so, that would probably map to a memo field in the view.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk

RE: No update tables are specified.

(OP)
Mike - thanks for the reply.

The View will not open in the View Designer since the source table has too many columns (over 200 fields) - at least that's the error message I get when I do try to open the View Designer.

Actually, while awaiting a reply I think that I finally got things working in spite of a mis-leading error message.

I have left out a
  CURSORSETPROP('Buffering',5,mcAlias)
Now I often do not need that line by relying solely on the inherent Row buffering, but apparently this time it is needed.

At least once I added it, the code began to work without the error message.

Thanks,
JRB-Bldr

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close