Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query timeout expired
Message
 
À
08/05/2018 09:53:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01659830
Message ID:
01659845
Vues:
49
>I do it this way
>
>
>thisform.ejecutar([P_COMPRASESP],[']+sfec1+[',']+sfec2+[',']+xsup+[',']+xstipo+[',']+xsmarca+[',']+xsmodelo+[',']+xsano+['])
>
>procedure ejecutar
>lparameters ccomando as string, lcparam as string
>cconnstring=_screen.cconnstring
>oconn = createobject("ADODB.Connection")
>ocomando = createobject("ADODB.Command")
>ors = createobject("ADODB.Recordset")
>oconn.connectionstring = cconnstring
>oconn.connectiontimeout = 60
>oconn.open
>if vartype(lcparam)="U" or vartype(lcparam)="L"
>	lcparam = ""
>endif
>ocomando.commandtext = ccomando+" "+lcparam
>ocomando.activeconnection = oconn
>ors = ocomando.execute()
>oconn = .null.
>ocomando = .null.
>return ors
>
As Martina said, try to use SPT instead of ADO:
procedure ejecutar
lparameters ccomando as string, lcparam as string
LOCAL laError[1]
lnHandler = SQLSTRINGCONNECT(_screen.cconnstring) && Be careful ADO and ODBC connection strings are not the same
IF lnHandler < 0
   AERROR(laError)
   MessageBox(laError[1,2])
   RETURN
ENDIF
IF SQLEXEC(m.lnHandler, ccomando) < 0
   AERROR(laError)
   MessageBox(laError[1,2])
   RETURN
ENDIF
SQLCLOSE(m.lnHandler)
NOT TESTED!
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform