Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it possible to use SQLPT on local tables?
Message
 
 
À
30/08/2010 04:30:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01479151
Message ID:
01479173
Vues:
66
This message has been marked as a message which has helped to the initial question of the thread.
>>>
>>>Avanzando,,, I created a DNS with the VFP ODBC driver as you suggested and added a connection to the second DBC pointing to the new DNS. The connection tested succesfully, but the following test code does not seem to work.
>>>
>>>
>>>SET DATABASE TO dacilsa
>>>lnhandle = SQLCONNECT('coneccion_dacilsa')  && lnHandle = 3
>>>lcCommand = [UPDATE Accounts SET Desc = ALLTRIM(Desc) + ' cambiado' WHERE Number = '100 ']
>>>?SQLEXEC(lnhandle,lcCommand)  && Returns -1
>>>
>>>
>>>What can be the problem?
>>>
>>>Alex
>>
>>Is Number a character column?
>>
>>Anyway, you can check the error report from the ODBC driver by inspecting the error array after an AERROR().
>>
>>LOCAL ARRAY laError(1)
>>... your code ...
>>
>>IF SQLEXEC(m.lnHandle,m.lcCommand)=-1
>>  AERROR(m.laError)
>>  IF m.laError(1,1) = 1526  && ODBC generated error
>>    FOR m.lnLoop = 1 TO ALEN(m.laError,1)
>>      ? m.laError(m.lnLoop,3)
>>    ENDFOR
>>  ENDIF
>>ENDIF
>>
>>(not tested - see AERROR() in Help for more details).
>
>Thank you Antonio. The values in the array are:
>1526
>"Connectivity error: [Microsoft][ODBC Visual FoxPro Driver]Syntax error."
>"[Microsoft][ODBC Visual FoxPro Driver]Syntax error."
>"37000"
>200
>3
>.NULL.
>
>I am not sure what the syntax error may be. I'll continue tomorrow. It's 3:30am here.
>

'DESC' is reserved word for SQL as in ORDER BY Something DESC. Try with another field.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform