I 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")) & " " & " "
& " " &" " &" " &" " &" "&" "&" "
&" "&" "&" "& (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")) & " " & " " & " "
&" " &" " &" " &" "&" "&" "
&" "&" "&" "& (ObjRecordSet2("COUNT")) & "<br>"
vn = vn + vn1
Elseif Left(ObjRecordSet2("WORKSTATION"),3) =
"W10" Then
testnb = CInt(ObjRecordSet2("COUNT"))
newb = newb + testnb
nb1= (ObjRecordSet2("Day")) & " " & " " & " "
&" " &" " &" " &" "&" "&" "
&" "&" "&" "& (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")) & " " & " " & " "
&" " &" " &" " &" "&" "&" "
&" "&" "&" "& (ObjRecordSet2("COUNT")) & "<br>"
dv = dv + dv1
End If
objRecordset2.movenext
Loop
objRecordset2.Close
objConnection2.Close
document.write ""
document.write "WESTHAMPTON" & "<br>"
document.write "DATE"& " " & " " & " "
&" "&" "&" "&" " &" " &" " &" " & "COUNT"
& "<br>"
document.write wh
document.write "Total For WestHampton: " & westh & "<br>" & "<br>"
document.write ""
document.write "VINELAND" & "<br>"
document.write "DATE" & " " & " " & " "
&" "&" "&" "&" " &" " &" " &" " & "COUNT"
& "<br>"
document.write vn
document.write "Total for Vineland: " & vnld & "<br>" & "<br>"
document.write ""
document.write" NEW BRUNSWICK" & "<br>"
document.write "DATE" & " " & " " & " "
&" "&" "&" "&" " &" " &" " &" " & "COUNT"
& "<br>"
document.write nb
document.write "Total for New Brunswick: " & newb & "<br>" & "<br>"
document.write ""
document.write"DOVER" & "<br>"
document.write "DATE"& " " & " " & " "
&" "&" "&" "&" " &" " &" " &" " & "COUNT"
& "<br>"
document.write dv
document.write "Total for Dover: " & dov
</script>
</div>
<p align="center"> </p>
</body>
</html> 3 6017
Basically speaking, run that script server-side, and instead of
document.write, you use Response.Write.
Get rid of the "<script type="text/vbscript"> stuff. Use:
<%
'''code
%>
Or, you can use
<script type="text/vbscript" runat="server"></script>,
but it's more common to use <% and %> as it's shorthand for that (assuming
VBScript is the declared language for the page, or the default language in
your app, which it is by default).
Ray at work
"pjglick" <pa**************@dol.state.nj.us> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com... I 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")) & " " & " " & " " &" " &" " &" " &" "&" "&" " &" "&" "&" "& (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")) & " " & " " & " " &" " &" " &" " &" "&" "&" " &" "&" "&" "& (ObjRecordSet2("COUNT")) & "<br>" vn = vn + vn1
Elseif Left(ObjRecordSet2("WORKSTATION"),3) = "W10" Then testnb = CInt(ObjRecordSet2("COUNT")) newb = newb + testnb nb1= (ObjRecordSet2("Day")) & " " & " " & " " &" " &" " &" " &" "&" "&" " &" "&" "&" "& (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")) & " " & " " & " " &" " &" " &" " &" "&" "&" " &" "&" "&" "& (ObjRecordSet2("COUNT")) & "<br>" dv = dv + dv1
End If objRecordset2.movenext Loop objRecordset2.Close objConnection2.Close
document.write "" document.write "WESTHAMPTON" & "<br>" document.write "DATE"& " " & " " & " " &" "&" "&" "&" " &" " &" " &" " & "COUNT" & "<br>" document.write wh document.write "Total For WestHampton: " & westh & "<br>" & "<br>" document.write "" document.write "VINELAND" & "<br>" document.write "DATE" & " " & " " & " " &" "&" "&" "&" " &" " &" " &" " & "COUNT" & "<br>" document.write vn document.write "Total for Vineland: " & vnld & "<br>" & "<br>" document.write "" document.write" NEW BRUNSWICK" & "<br>" document.write "DATE" & " " & " " & " " &" "&" "&" "&" " &" " &" " &" " & "COUNT" & "<br>" document.write nb document.write "Total for New Brunswick: " & newb & "<br>" & "<br>"
document.write "" document.write"DOVER" & "<br>" document.write "DATE"& " " & " " & " " &" "&" "&" "&" " &" " &" " &" " & "COUNT" & "<br>" document.write dv document.write "Total for Dover: " & dov
</script>
</div> <p align="center"> </p> </body> </html>
Thank you very much for replying
When I add the <script type="text/vbscript" runat="server"></script>
I get the following message.
The tag: "script" doesn't have an attribute: "runat" in currently
active versions. I am using IE6.
Any suggestions
Paul
"pjglick" wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
: Thank you very much for replying
It was nothing. (O:=
: When I add the <script type="text/vbscript" runat="server"></script>
:
: I get the following message.
:
: The tag: "script" doesn't have an attribute: "runat" in currently
: active versions. I am using IE6.
:
: Any suggestions
Yes, use ASP tags instead of script tags as Ray suggested.
<%@ Language="VBScript" %>
<%
Option Explicit
Response.Buffer = True
' inline code
' global variables
' code goes here
sub someSub(someParameter)
' local variables
' code goes here
end sub
function someFunction(someParameter, someOtherParameter)
' local variables
' code goes here
someFunction = someValueOfSomeCalculationOfSomeLocalVariable
end function
%> http://w3schools.com/asp/
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jerry wang |
last post by:
I manipulate MSAgent AcitiveX object using VBScript at client side, I
met a wierd problem when I debugged my ASPX page. when msagent recognize
a phrase and fire event, my vbscript capture the event...
|
by: NanQuan |
last post by:
I'm hoping someone can help me solve this error since I am at a total
loss here. Usually I don't bother posting on any forums or groups on
the internet and prefer to solve stuff myself but this is...
|
by: Anshul Gupta |
last post by:
Hi,
Is there a way i can just print a designated area out of the whole
asp(or html) page using javascript or vbscript.
i want to mark out the beginning and the end on the page and create a
link...
|
by: skeddy |
last post by:
In a nutshell, I'm trying to dynamically create a select box with
ResultSet code in vbscript and then need to be able to access the value
of that select box later with a Save button.
I've got...
|
by: Beemer Biker |
last post by:
I put together a few lines of vbscript so I could dump the contents of a
string to my C drive. It worked fine in a small test.htm where I put the
vbscript at the top of the file. It failed to...
|
by: Andrew Wan |
last post by:
How can VBScript code access JScript code variables in the same ASP page?
<SCRIPT LANGAUGE="VBScript">
Dim a
a = 10
</SCRIPT>
<SCRIPT LANGUAGE="JScript">
Response.Write(a);
</SCRIPT>
|
by: wallconor |
last post by:
Hi,
I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my...
|
by: Soniad |
last post by:
Hello,
I want to include asp file within vbscript, this file name i am taking in variable .
and when i use this variable in the include tag outside delimiters(<%%>), it does not work,
<%Dim...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |