M
M
MatSkywalker2014-04-14 04:30:24
Windows Script Host
MatSkywalker, 2014-04-14 04:30:24

ADODB - how to connect to a data source in a WSF script?

I am connecting to the database via ADODB.
Question: how to create an ADODB.Connection in a WSF script so that you can then use it from different languages?
Created for VBscript is unreachable in JScript. In the sense that having opened a connection in one, it is necessary to open it in another. Can I somehow make a common connection object so as not to cling to the database from each?
<object id="DBConn" progid="ADODB.Connection"/>

<?xml version='1.0' encoding='windows-1251'?>
<job>
    <object id="objConnection" progid="ADODB.Connection"/>
    <script language="VBScript">
        WScript.Echo TypeName(objConnection)
        WScript.Echo objConnection.Version
    Udlread="DSN=Dbf"
    objConnection.Open(Udlread)
    </script>
    
    <script language="JScript">
        WScript.Echo(typeof(objConnection));
        WScript.Echo(objConnection.Version);
    // Вот если тут попробовать обратиться к objConnection, окажется, что соединение закрыто.
    </script>
</job>

Answer the question

In order to leave comments, you need to log in

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question