41315members
184300posts

[Imported] Mimic Script Server.Query don't work

Highlighted
Sisko

[Imported] Mimic Script Server.Query don't work

>>Message imported from previous forum - Category:ClearSCADA Software<<
User: florian, originally posted: 2018-10-25 20:20:39 Id:303
This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.

-------------------------------

**_dareksm:_**
**_I cannot receive data when I use function Server.Query from mimic script (from any table)._**

**_I always get the error:_**

_PrepareQuery failed : Unknown Error 0x80072f19_

**_The same query runs in datagrid table works fine._**

**_This is my sample script:_**

Public Sub GetData()_
Dim DGRS _
Set DGRS = Server.Query("SELECT * FROM CDBPoint")_
If NOT(DGRS.Error) Then_
Msgbox OK, vbOK, "NO ERROR"_
Else_
Msgbox DGRS.ErrorMessage, vbCritical + vbOKOnly, "Error in SQL Command"_
End If_
End Sub_

------------------

AWoodland:
Hi,

Have a look at http://resourcecentre.controlmicrosystems.com/display/CS/Diagnosing+Scripting+Connection+Errors, it should help you identify the possible causes.

The mostly likely cause is that the ClearSCADA WebX port is in use by something else, IIS for example, and so ViewX scripting can't connect to get data.