Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help converting javascript to vb script

Status
Not open for further replies.

Pablo4077

Programmer
May 30, 2003
3
US
I don't fully understand javascript could someone help me convert this to VBS, this is the code:
var logQuery=new ActiveXObject("MSUtil.LogQuery");
var recordSet=logQuery.Execute(&quot;SELECT * FROM <1>&quot;);

for(; !recordSet.atEnd(); recordSet.moveNext())
{
var record=recordSet.getRecord();
for(var col=0; col<recordSet.getColumnCount(); col++)
{
if(record.isNull(col))
WScript.Echo(&quot;NULL&quot;);
else
WScript.Echo(record.getValue(col));
}
}var logQuery=new ActiveXObject(&quot;MSUtil.LogQuery&quot;);
var recordSet=logQuery.Execute(&quot;SELECT * FROM <1>&quot;);

for(; !recordSet.atEnd(); recordSet.moveNext())
{
var record=recordSet.getRecord();
for(var col=0; col<recordSet.getColumnCount(); col++)
{
if(record.isNull(col))
WScript.Echo(&quot;NULL&quot;);
else
WScript.Echo(record.getValue(col));
}
}
 
Personally I do't know why anyone would /want/ to go in this direction, but lets see:

dim logQuery
dim recordSet
dim record
dim col

logQuery = ActiveXObject(&quot;MSUtil.LogQuery&quot;)
recordSet = logQuery.Execute(&quot;SELECT * FROM <1>&quot;)
while not recordSet.atEnd
record = recordSet.getRecord
for col = 0 to recordSet.getColumnCount - 1
if record.isNull(col) then
WScript.Echo &quot;NULL&quot;
else
WScript.Echo record.getValue(col)
end if
next
recordSet.moveNext
wend

I assume you accidentally pasted the code in twice?

Above code was off top of head and as such is untested.

codestorm
Newbie Life Member.
Fire bad. Tree pretty. - Buffy
<insert witticism here>
 
Want to go whitch direction? using VBS or using the logparser com?
 
From Javascript to VBScript

codestorm
Newbie Life Member.
Fire bad. Tree pretty. - Buffy
<insert witticism here>
 
Because I program in VB and its easer for me to convert VBS to VB than to learn a new Language.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top