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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL connection string within VBScript

Status
Not open for further replies.

plarsen

Programmer
Jul 30, 2002
27
DK
Hi

I have an ASP-page with some VBScript in it!
In the following VBScript part BR should return minimum 1 record, if the user (powner) is in the tabel, but it doesn't.

-- Code begin --

powner = xa.activesheet.cells(3,15)
SQL = "SELECT Init FROM brugere WHERE Init = ' & powner & "'"
set BR = conn.execute(SQL)

if BR.EOF then
if sprog = "DK" then
alert "Ikke godkendt procesejer - registreret bruger (" & powner & ")!"
else
alert "Unapproved processowner - registered user (" & powner & ")!"
end if
window.location.href = "excelimport.asp"
end if

-- Code end --

I hope someone can help me?

Kind Regards

Peter Larsen
 
Try this code- you need to seperate front and back end code



<script language=text/javascript>
<%
if BR.EOF then
if sprog = &quot;DK&quot; then
%>
alert(&quot;Ikke godkendt procesejer - registreret bruger\(<%=powner%>\)!&quot;)
<%
End if
Do while not br.eof
%>
alert(&quot;Unapproved processowner - registered user\(<%=powner%>\)!&quot;)
window.location.href = &quot;excelimport.asp&quot;
<%
rs.MoveNext
Loop
%>
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top