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!

JavaScript to VBScript translation 1

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
Would anyone know how to do the following in VBScript?
Thanks for helping a brother out!
----------
var conn = Server.CreateObject("ADODB.Connection");
conn.ConnectionString="Driver={SQL Server};Server=xxx;UID=yyy;PWD=zzz";
conn.Open();
rs=Server.CreateObject("ADODB.RecordSet");
rs.CursorType=0;
rs.CursorLocation=3;
rs.LockType=1;
sSQL="Select * From aaa";
rs.Open(sSQL,conn);
----------
while (!rs.eof) {
    if (counter == 0) {
       .....
    }
rs.MoveNext();
}
 
dim Conn,Rs,sSQL,iCounter

set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString="Driver={SQL Server};Server=xxx;UID=yyy;PWD=zzz"
Conn.Open()
Rs=Server.CreateObject("ADODB.RecordSet")
Rs.CursorType=0
Rs.CursorLocation=3
Rs.LockType=1
sSQL="Select * From aaa"
Rs.Open sSQL,Conn
----------
do while not rs.eof {
if iCounter =0 then

end if
Rs.MoveNext()
loop

With VBScript and any language ALWAYS declare your variables.
"did you just say Minkey?, yes that's what I said."

MrGreed
 
I won't be trying it out till later but I'll go ahead and star ya for the effort now...
 
for the sake of the string- it needs this correctio n as well:

set Rs=Server.CreateObject("ADODB.RecordSet")

set being the missing item from the original post
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top