Hail,
I just started to use ASP. I'm used to VB so this is what I want to do. When a user clicks on a button, I want to write a response on the page by retrieving data from a table. I figured out how to retrieve the data with the following:
<%
sql="select * from Players"
Set OBJdbConnection = Server.CreateObject("ADODB.Connection"
OBJdbConnection.Open "Glad"
Set RS=OBJdbConnection.Execute(sql)
%>
<%=RS("Password"%>
<%
OBJdbConnection.Close
%>
But what I don't understand is how can I launch this when the user clicks on my button??? I tried to put the above script into the following:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
<%
sql="select * from Players"
Set OBJdbConnection = Server.CreateObject("ADODB.Connection"
OBJdbConnection.Open "Glad"
Set RS=OBJdbConnection.Execute(sql)
%>
<%=RS("Password"%>
<%
OBJdbConnection.Close
%>
End Sub
</SCRIPT>
Now I know that is wrong, but can someone maybe point me in the right direction?
Phailak
I just started to use ASP. I'm used to VB so this is what I want to do. When a user clicks on a button, I want to write a response on the page by retrieving data from a table. I figured out how to retrieve the data with the following:
<%
sql="select * from Players"
Set OBJdbConnection = Server.CreateObject("ADODB.Connection"
OBJdbConnection.Open "Glad"
Set RS=OBJdbConnection.Execute(sql)
%>
<%=RS("Password"%>
<%
OBJdbConnection.Close
%>
But what I don't understand is how can I launch this when the user clicks on my button??? I tried to put the above script into the following:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
<%
sql="select * from Players"
Set OBJdbConnection = Server.CreateObject("ADODB.Connection"
OBJdbConnection.Open "Glad"
Set RS=OBJdbConnection.Execute(sql)
%>
<%=RS("Password"%>
<%
OBJdbConnection.Close
%>
End Sub
</SCRIPT>
Now I know that is wrong, but can someone maybe point me in the right direction?
Phailak