Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question