Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote Views vs. sqlprepare() sqlexec()
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00491044
Message ID:
00491052
Views:
9
KEY is a reserved word in SQL Server. You don't specify a back end. It may also be a reserved word in other back ends. Try changing the field name and see if that helps.

>I am connected to our companies database through a ODBC defined connection. I am able to sucessfully download a group of records using the following database defined remove view:
>
>SELECT coitem.co-num, coitem.co-LINE, coitem.co-RELEASE, coitem.ITEM, ;
>coitem.qty-ordered, coitem.ref-TYPE, coitem.ref-num, coitem.ref-LINE-suf, ;
>coitem.CUST-ITEM, notes.txt ;
>FROM coitem coitem, notes notes ;
>WHERE notes.KEY = coitem.KEY ;
>AND (coitem.ref-TYPE = "J" ;
>AND coitem.ref-num <> " " ;
>AND notes.seq = 1)
>
>I then copied the SQL statement created with the remote view and placed into a program using a SQLConnect(), SQLPrepare(), SQLExec() commands. When the program reaches the SQLPrepare() command I recieve the error "Command contains unrecognized phrase/keyword." The code where it pukes is this:
>
>sqlprepare(gnconnhandle,'SELECT coitem.co-num, coitem.co-LINE, coitem.co-RELEASE, coitem.ITEM, ;
>coitem.qty-ordered, coitem.ref-TYPE, coitem.ref-num, coitem.ref-LINE-suf, ;
>coitem.CUST-ITEM, notes.txt ;
>FROM coitem coitem, notes notes ;
>WHERE notes.KEY = coitem.KEY ;
>AND (coitem.ref-TYPE = "J" ;
>AND coitem.ref-num <> " " ;
>AND notes.seq = 1)','tempsqlwip_orders')
>
>Can anyone help me get this code to function?
>
>TIA,
>Jeff
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform