Trigger VBScript by click on Push Button

Trigger VBScript by click on Push Button

am 30.01.2005 02:51:49 von Eddy Scheire

Hi all,

I'd like to trigger a VBScript by clicking on a push button, but I always
get errors and the line number and error
description don't make any sense (Line: 29 Char: 6 ';' expected)

Line 29 =
Response.Write "

Items Found for Category:

"
where the building of the page stops after


The code is :







Some Database 1.0





<%

Function GetNames(GenreStr)

Dim DB
Set DB = Server.CreateObject ("ADODB.Connection")
DB.Open ("Provider=Microsoft.Jet.OLEDB.4.0; DATA SOURCE= " +
Server.MapPath("Muziek.mdb"))

Dim RS
Set RS = Server.CreateObject ("ADODB.Recordset")
RS.Open "SELECT * FROM Namen WHERE Genre=GenreStr ORDER BY Naam ASC", DB

If RS.RecordCount = 0 Then
Response.Write "No records found for category "
Else
Response.Write "

Items Found for Category:

"
Response.Write ""
End If
RS.Close
Set RS=Nothing
DB.Close
Set DB=Nothing

End Function

%>

color="#0000FF">MUZIEKDATABASE









































 





I don't understand anything of it!!

Thanx in advance,
Eddy

Re: Trigger VBScript by click on Push Button

am 30.01.2005 13:03:31 von exjxw.hannivoort

Eddy Scheire wrote on 30 jan 2005 in microsoft.public.inetserver.asp.db:
> I'd like to trigger a VBScript by clicking on a push button, but I always
> get errors and the line number and error
> description don't make any sense (Line: 29 Char: 6 ';' expected)

If by "VBscript" you mean serverside scripting under ASP, as you show,
[incorrect, because under IE VBscript can also be used clientside, and
Javascript, read Jscript, can be used under ASP serverside]

Think also about the following:

Serverside scripting is finished when the page is rendered [as HTML]
and sent to the client.

>

The Onclick launches a clientside script, and can NEVER access a serverside
function, perhaps 5000 km away on another machine, that it is NOT connected
to at that moment.

Your clientside error furthermore probably could complain about the wrong
use of double quotes inside each other: "Call GetNames("DA")", wich is not
allowed in the default javascript of your browser, even before it finds the
statement "Call" and the function GetNames() do not exist in your
clientside (=browser's) javascript.


--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)