Try adding the specific server to your connectionstring and see if that doesn't work. Server=myserver;
John -----Original Message----- From: profox-boun...@leafe.com [mailto:profox-boun...@leafe.com] On Behalf Of Rafael Copquin Sent: Wednesday, February 08, 2012 10:49 AM To: profox@leafe.com Subject: Re: decimals in remote data I tried using cast as you suggest but nothing worked. However, I had been using this statement to make the connection: cConnString = [DSN=aerolom;UID=sa;PWD=12345;APP=Sistema operativo Microsoft® Windows®;WSID=RAFANUEVA;DATABASE=aerosql;LANGUAGE=Español;Regional=Yes;] nHandle = sqlstringconnect(cConnString) with the above, everything failed as described However, using the DSN,thus: nHandle = SQLConnect('aerolom','sa','12345') it all worked like a charm without the need to use the cast function as you said. Now my problem is solved. However, does anybody know why this happened? Why using a connection string things get messed up, but using a DSN they don't? Or rather, with SQLStringConnect and a connection string it fails but with SQLConnect and the DSN name, plus UID adn PWD it all works as expected? BTW Richard, thanks for your help but this puzzles me Rafael El 08/02/2012 12:57, Richard Kaye escribió: > I would use CAST in your SQL to make sure you get back the precision you want. You still may need a SET DECIMALS setting and maybe try SET FIXED OFF instead of ON. > > -- > rk > > > -----Original Message----- > From: profoxtech-boun...@leafe.com > [mailto:profoxtech-boun...@leafe.com] On Behalf Of Rafael Copquin > Sent: Wednesday, February 08, 2012 10:37 AM > To: profoxt...@leafe.com > Subject: decimals in remote data > > My last post was directly translated from the same one in Spanish sent > to a local users group, and I missed translating the subject > > Here it goes again, please help me > > Rafael > > quote > > I have an app built in VFP9SP2 as a front end and SQLServer Express > 2008 > RS2 as backend. The connection is made by ODBC and the network is a > LAN (no internet involved) > > Using SQL PassThrough I bring records from a table with a numeric data field of size 14 with 4 decimals. > > If I run the sql sentence in TSQL , using the Management Studio,like so: > > select code,descrip,qty from stock where code = 'XD-98789' I get the correct result, namely: > > code descrip qty > > XD-98789 WIDGET 3585256,1234 > > > But, running the same sentence in SPT, like so: > > cCode ='XD-98789' > > sqlexec(nHandle,[select code,descrip,qty from stock where code > =]+[']+cCode+['],'curStock') > > I get the following result > > code descrip qty > > XD-98789 WIDGET 3585256,12 (it shows 2, not 4 decimals) > > SET DECIMALS TO 4 is useless. > > But the worst is if I use SET FIXED ON and then SET DECIMALS TO 4 > > > code descrip qty > > XD-98789 WIDGET 3,585 > > It truncates the integer part of the quantity and shows the result with 4 decimals, which are the following digits > of the integer part. > > What the heck is going on here? > > unquote > > > Rafael Copquin > > > [excessive quoting removed by server] _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/006901cce682$ec8f8f30$c5aead90$@shelbynet.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.