am sorry if this sounds hokey but I am a newbie to ASP.



I have a VBScript running in an ASP page. The script makes a
connection to Oracle via and ADODB connection. When my clients connect
to the ASP page they get Oracle client issues. How do I make the
script run from the server side to eliminatew any oracle client issues
or oracle tns names issues.

Hope someone can help



Paul

Code



<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
<title>Untitled Document</title>
</head>

<body>
<div align="center"><img src="pics/banner_new.jpg" width="700"
height="80" /> <br />




<script type="text/vbscript">

Const adOpenStatic = 3
Const adLockOptimistic = 3

Set objConnection2 =
CreateObject("ADODB.Connection")
Set objRecordset2 = CreateObject("ADODB.Recordset")

objConnection2.Open = "DRIVER={Microsoft ODBC for
Oracle}; SERVER=<removed>; UID=<removed>; PWD=<removed>"

strQuery1 = "SELECT TRUNC(log_date_time)
DAY,UPPER(SUBSTR(workstation,1,3)) WORKSTATION, COUNT(*) COUNT FROM
member_log WHERE logon_type='LOGON' GROUP BY
TRUNC(log_date_time),UPPER(SUBSTR(workstation,1,3))"
' strQuery1 = "Select * from member_log"



objRecordset2.Open strQuery1, _
objConnection2, adOpenStatic, adLockOptimistic


' If Not objRecordSet.EOF Then
'objRecordSet.MoveFirst

Do Until objRecordSet2.EOF



If Left(ObjRecordSet2("WORKSTATION"),3) = "W03"
Then
'document.write "WESTAMPTON" & vbTab &
(ObjRecordSet2("WORKSTATION")) & vbTab & (ObjRecordSet2("DAY")) & vbTab
& (ObjRecordSet2("COUNT"))
wh1= (ObjRecordSet2("Day")) & "&nbsp" & "&nbsp"
& "&nbsp" &"&nbsp" &"&nbsp" &"&nbsp" &"&nbsp"&"&nbsp"&"&nbsp"
&"&nbsp"&"&nbsp"&"&nbsp"& (ObjRecordSet2("COUNT")) & "<br>"
wh = wh + wh1
testw = CInt(ObjRecordSet2("COUNT"))
westh = westH + testw
Elseif Left(ObjRecordSet2("WORKSTATION"),3) = "W05" Then
testv = CInt(ObjRecordSet2("COUNT"))
vnld = vnld + testv
vn1= (ObjRecordSet2("Day")) & "&nbsp" & "&nbsp" & "&nbsp"
&"&nbsp" &"&nbsp" &"&nbsp" &"&nbsp"&"&nbsp"&"&nbsp"
&"&nbsp"&"&nbsp"&"&nbsp"& (ObjRecordSet2("COUNT")) & "<br>"
vn = vn + vn1

Elseif Left(ObjRecordSet2("WORKSTATION"),3) =
"W10" Then
testnb = CInt(ObjRecordSet2("COUNT"))
newb = newb + testnb
nb1= (ObjRecordSet2("Day")) & "&nbsp" & "&nbsp" & "&nbsp"
&"&nbsp" &"&nbsp" &"&nbsp" &"&nbsp"&"&nbsp"&"&nbsp"
&"&nbsp"&"&nbsp"&"&nbsp"& (ObjRecordSet2("COUNT")) & "<br>"
nb = nb + nb1
Elseif Left(ObjRecordSet2("WORKSTATION"),3) = "W05"
Then
testv = CInt(ObjRecordSet2("COUNT"))
vnld = vnld + testv
vn1= (ObjRecordSet2("Day")) & vbTab & (ObjRecordSet2("COUNT")) &
"<br>"
vn = vn + vn1


Elseif Left(ObjRecordSet2("WORKSTATION"),3) = "W12"
Then
testd = CInt(ObjRecordSet2("COUNT"))
dov = dov + testd
dv1= (ObjRecordSet2("Day")) & "&nbsp" & "&nbsp" & "&nbsp"
&"&nbsp" &"&nbsp" &"&nbsp" &"&nbsp"&"&nbsp"&"&nbsp"
&"&nbsp"&"&nbsp"&"&nbsp"& (ObjRecordSet2("COUNT")) & "<br>"
dv = dv + dv1





End If
objRecordset2.movenext
Loop
objRecordset2.Close
objConnection2.Close

document.write ""
document.write "WESTHAMPTON" & "<br>"
document.write "DATE"& "&nbsp" & "&nbsp" & "&nbsp"
&"&nbsp"&"&nbsp"&"&nbsp"&"&nbsp" &"&nbsp" &"&nbsp" &"&nbsp" & "COUNT"
& "<br>"
document.write wh
document.write "Total For WestHampton: " & westh & "<br>" & "<br>"
document.write ""
document.write "VINELAND" & "<br>"
document.write "DATE" & "&nbsp" & "&nbsp" & "&nbsp"
&"&nbsp"&"&nbsp"&"&nbsp"&"&nbsp" &"&nbsp" &"&nbsp" &"&nbsp" & "COUNT"
& "<br>"
document.write vn
document.write "Total for Vineland: " & vnld & "<br>" & "<br>"
document.write ""
document.write" NEW BRUNSWICK" & "<br>"
document.write "DATE" & "&nbsp" & "&nbsp" & "&nbsp"
&"&nbsp"&"&nbsp"&"&nbsp"&"&nbsp" &"&nbsp" &"&nbsp" &"&nbsp" & "COUNT"
& "<br>"
document.write nb
document.write "Total for New Brunswick: " & newb & "<br>" & "<br>"

document.write ""
document.write"DOVER" & "<br>"
document.write "DATE"& "&nbsp" & "&nbsp" & "&nbsp"
&"&nbsp"&"&nbsp"&"&nbsp"&"&nbsp" &"&nbsp" &"&nbsp" &"&nbsp" & "COUNT"
& "<br>"
document.write dv
document.write "Total for Dover: " & dov





</script>

</div>
<p align="center">&nbsp;</p>
</body>
</html>

Re: VBSCript inside ASP page by Hal

Hal
Thu Nov 03 20:26:49 CST 2005

> I have a VBScript running in an ASP page. The script makes a
> connection to Oracle via and ADODB connection. When my clients connect
> to the ASP page they get Oracle client issues. How do I make the
> script run from the server side to eliminatew any oracle client issues
> or oracle tns names issues.
>

Try the ASP tutorial here: www.w3schools.com
The site has tutorials on ASP, ADO, and VBScript and bunches of others.
If you already know vbscript, you'll see the tags you need and the ability
to jump in and out of html.
Its worth spending the time - rather than having someone convert your
browser script to server script.
HTH