发布新帖

查找

讨论 (4)0
登录或注册以继续
问题
· 二月 13, 2019

Intersystems Cache and MS Access Passthrough

Edit:

May have found the issue but not the solution.

"SELECT * FROM wmhISTORYdETAIL" runs as a passthrough without asking for the DNS.

but

'SELECT Count([wmhISTORYdETAIL].[HistHMNumber] AS CountOfHistHMNumber FROM [wmhISTORYdETAIL] WHERE ((([wmhISTORYdETAIL].[HistMovType])='Receipt') AND (([wmhISTORYdETAIL].[HistMovDate])>=Date()-1) AND (([wmhISTORYdETAIL].[HistMovDate])<Date()));'

asks for the DNS but both are linked to a table that has the password saved.

Any Ideas please?

Rob

Hi

I have created an MS Access database with a passthrough query to our Intersystems Cache WMS system. If I use "SELECT * from thetable"  as the passthough query I can use VB.NET to query the passthrough and it works fine but this dataset getting rather large so I changed it to

"Select field1, field2, filed3 from thetable" but the passthrough no longer works as it did.....it works in MS Access but not from the VB.NET app.

The VB.Net Query is:

SELECT Count([xxx].[HistHMNumber] AS CountOfHistHMNumber FROM [xxx] WHERE ((([xxx].[HistMovType])='Receipt') AND (([xxx].[HistMovDate])>=Date()-1) AND (([xxx].[HistMovDate])<Date()));

where [xxx] is the passthrough query

but now I get an ODBC error in the VB.Net app

"System.Data.OleDb.OleDbException: 'ODBC--call failed.'"

The error/issue appears to be in the SQL but if Im lift it and paste it into the MS Access database. it works?!?!

Any help would be appreciated.

Many Thanks

Rob

1 Comment
讨论 (1)1
登录或注册以继续
文章
· 二月 8, 2019 阅读大约需 2 分钟

Client Websockets based CSP

The Caché / Ensemble standard distribution contains in namespace SAMPLES
a nice example of a CSP page consuming WebService as a Client.
I have modified it not only to display the replies but to feed them back into a Global.
I used the classic Hyperevent to achieve this. The replies end up as a log in global^WSREPLY.
When there is no input anymore the page closes and goes away.

There are 2 versions with visible and hidden display during operation.
dc.WSCSP.reverseVerbose.cls and dc.WSCSP.reverseHidden.cls

The message to send is simply passed as a hash after the CSP_URL. (Mind URL encoding!)

You can launch the page using a command pipe or $zf(-1,...) or similar for newer versions
directly out of your application or from the command line.

 /// find your browser location
 set browser="""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"" "
 /// don't forget the # at the end
 set page="http://localhost:57772/csp/"_$namepace_"/dc.WSCSP.reverseVerbose.cls#"
 /// whatever you send to the server
 set msg="hello ALL"
 /// a CPIPE device
 set dev="|CPIPE|22"

// either
do $zf(-1,browser_page_msg)

// or
open dev:browser_page_msg:0 write $t close dev

and what you get on server looks like this:


^WSREPLY(34)=$lb("2019-02-08 18:03:11","Welcome to Cache WebSocket. NameSpace: SAMPLES")
^WSREPLY(35)=$lb("2019-02-08 18:03:11","'hello ALL' (length=9) recieved on 08 Feb 2019 at 06:03:11PM NameSpace=SAMPLES")
^WSREPLY(36)=$lb("2019-02-08 18:03:21","Timeout after 10 seconds occurred on 08 Feb 2019 at 06:03:21PM")
^WSREPLY(37)=$lb("2019-02-08 18:03:31","Timeout after 10 seconds occurred on 08 Feb 2019 at 06:03:31PM")
^WSREPLY(38)=$lb("2019-02-08 18:03:41","Timeout after 10 seconds occurred on 08 Feb 2019 at 06:03:41PM")
^WSREPLY(39)=$lb("2019-02-08 18:03:41","exit")

This is just a starting point to be adapted to your individual needs.

With Docker it might be hard to start a browser. ZPM is preferred.

GitHub

讨论 (0)1
登录或注册以继续
文章
· 二月 8, 2019 阅读大约需 2 分钟

Client Websockets based on Node.js

It will demonstrate the wide range that is openend by making use
of the power embedded in Node.js and its adapter to Caché, Ensemble, Health,..*
Node / JavaScript have wide reputation to work as a WebSocket client.
By using the Caché adapter it becomes easy to control it and to consume the results as a
Client for WebSocket Servers and to collect the replies in Caché, Ensemble, ..

I used node-v6.16.0-x64.msi and cache610.node as cache.node

You provide a Global for input:

 ^WsockIn="wss://ws.postman-echo.com/raw"
 ^WsockIn(0)=6
 ^WsockIn(1)="Hello"
 ^WsockIn(2)="World !"
 ^WsockIn(3)="Robert"
 ^WsockIn(4)="is waiting"
 ^WsockIn(5)="for replies"
 ^WsockIn(6)="exit"

and with this echo server you get back a Global as output

 ^WsockOut(0)=6
 ^WsockOut(1)="Hello"
 ^WsockOut(2)="World !"
 ^WsockOut(3)="Robert"
 ^WsockOut(4)="is waiting"
 ^WsockOut(5)="for replies"
 ^WsockOut(6)="exit"

you may call it from with class code or routine or command line

  kill ^WsockOut
  do $zf(-1,"node ""C:\Program Files\nodejs\user\WsockDemo""")
  zwrite ^WsockOut

or in verbose mode

  SAMPLES>$node "C:\Program Files\nodejs\user\WsockDemo"

start
server: wss://ws.postman-echo.com/raw
Lines to process: 6

WebSocket Client Connected
client ready

Line: 1 text: Hello
Line: 2 text: World !
Line: 3 text: Robert
Line: 4 text: is waiting
Line: 5 text: for replies
Line: 6 text: exit
lines sent: 6

Received: 'Hello'
Received: 'World !'
Received: 'Robert'
Received: 'is waiting'
Received: 'for replies'
Received: 'exit'
replies received: 6

Client Closed
SAMPLES>

Using the WebSocket Server in namespace USER

ws://localhost:57772/csp/user/Web.SocketTest.cls

the replies look like this:

Received: 'Welcome to Cache WebSocket. NameSpace: SAMPLES'
Received: ''Hello' (length=5) recieved on 08 Feb 2019 at 02:57:08PM NameSpace=USER'
Received: ''World !' (length=7) recieved on 08 Feb 2019 at 02:57:08PM NameSpace=USER'
Received: ''Robert' (length=6) recieved on 08 Feb 2019 at 02:57:08PM NameSpace=USER'
Received: ''is waiting' (length=10) recieved on 08 Feb 2019 at 02:57:08PM NameSpace=USER'
Received: ''for replies' (length=11) recieved on 08 Feb 2019 at 02:57:08PM NameSpace=USER'
replies received:  6

Client Closed

.
. .
I have to admit this was my first piece of code to run in Node.js.

GitHub

讨论 (0)1
登录或注册以继续
问题
· 二月 1, 2019

How to recalculate XSL pages from Portrait to Landscape

Hello all,

I have an XSL question and I wanted to see if someone within a community can help me out.  

To Summarize: I am working with XSL documents, single and multi-pages.  
Inside my style sheet XML document, which is supporting my pages, everything on the page, including a headers, footers and the items are calculated 
based on the portrait measurements. 
Pages come up on the screen as portrait, but sometimes, depending on dynamic data are wide, they do not print properly in portrait.

If I turn them to  print in Landscape, now the page fit fine, but the measurements which were calculated for portrait do not readjust and therefore I have issues, specially with footers, which are never at the bottom of the pages anymore.

Question: Is there a way to recalculate XSL pages and change them smoothly from Portrait to Landscape orientation when it's needed during the run or the other way around?
Secondly, is there a way I can specify the printing option -> Landscape from the start for some of my XSL pages, which do not fit well in portrait mode?. Basically I want to set the Landscaping printing mode as soon as I see that the data is too wide for portrait page and avoid the extra step of doing it by hand.

Thank you for your time,
Alex K

1 Comment
讨论 (1)1
登录或注册以继续