Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query timeout expired
Message
From
08/05/2018 10:47:33
 
 
To
08/05/2018 09:53:47
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01659830
Message ID:
01659845
Views:
50
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform