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!

Help! Translate from JavaScript to VBScript

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();
}
 
TheConehead,

SQL_Server = "MyServername"
Dbase = "MyDatabase"
UID = "MyUsername"
PASSWORD = "Mypassword"

strConn = "PROVIDER=SQLOLEDB;" & _
"DRIVER={SQL Server};" & _
"SERVER=" & SQL_Svr & ";" & _
"DATABASE=" & DBase & ";" & _
"UID=" & UID & ";" & _
"PWD=" & PASSWORD

Set Cn = CreateObject("ADODB.Connection")
Cn.open strConn

Set rs = Server.CreateObject("ADODB.Recordset")
rs.open Select * From aaa", Cn, 1, 3

Do While NOT rs.eof
....
....
rs.movenext
Loop


fengshui_1998
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top