How to Return the Output Value from Vbs File to java class
694 views
Skip to first unread message
Venkat Kandula
unread,
Dec 19, 2014, 4:17:01 AM12/19/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mercu...@googlegroups.com
Hi All,
I am facing typical scenario is how to return the value from vbs file to java class.
Please see the below code for better understanding...
Vbs Code:
RetrunValue=DBConnction()
Function DBConnction()
Dim objConnection 'Set Adodb Connection Object Set objConnection = CreateObject("ADODB.Connection") Dim objRecordSet
'Create RecordSet Object Set objRecordSet = CreateObject("ADODB.Recordset") Dim DBQuery 'Query to be Executed DBQuery = "Select NAME from dbo.EMPLOYEE where AGE = 29" 'Connecting using SQL OLEDB Driver objConnection.Open "Provider=sqloledb;Server=10.91.64.12;User Id=sa;Password=sunp@55;Database=VIMS" 'Execute the Query objRecordSet.Open DBQuery,objConnection 'Return the Result Set Value = objRecordSet.fields.item(0) 'msgbox Value DBConnction=Value ' Release the Resources objRecordSet.Close objConnection.Close Set objConnection = Nothing Set objRecordSet = Nothing End Function