Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CA and SQL syntax problem
Message
From
21/07/2006 14:40:31
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01137447
Message ID:
01138678
Views:
10
John,

>Thank you for your input, but the problem I'm having is with how the SECOND "ORDER" noun is behaving. When the command is passed to SQL, SQL takes the string literally, and sees the "?CMS.ORDER" as "?CMS. ORDER", which returns a syntax-error. I haven't tried assiging CMS.ORDER to another variable, but even if it works, this is not a workable solution since TABLEUPDATE would need to have the ability to reassign this variable for each update. Any other ideas?

I am late to this thread, but notice that the Title mentions CA as your data access mechanism. You say you can create a cursor via CA with no problems but cannot update the backend SQL server. You then show what you have "isolated" as the problem update statement.

Is this problem update statement being automatically generated by the CA class when you make a change to a record and call Tableupdate()? How are you isolating the statement?

You say that "SQL takes the string literally" -- how do you know that? Are you looking at the actual statement being passed through to SQL by looking at a SQL Server Profiler trace or are you assuming that SQL "sees" the statement that way? The reason I ask is that substitutions of "?" values and creation of named command parameters is handled automatically on the VFP side by CA BEFORE the resulting statement is sent to SQL Server.

If you have not looked at a Profiler trace of what is being sent to SQL Server, please do that and report back.

I'm sorry if my questions might insult your intelligence, but in this kind of troubleshooting, it's usually best to eliminate as many red herrings as possible early in the process. :-)
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform