Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASP

Posted on 1999-07-28
2
Medium Priority
?
200 Views
Last Modified: 2010-04-30
I am "VB Programmer".But i don't know how to use ASP.Explain with some simple example with coding how i can use ASP in my "Visual Basic" ?
0
Comment
Question by:bhavesh55
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
mayhew earned 20 total points
ID: 1528032
ASP isn't really something you use in Visual Basic.  It's more of a method of making web pages dynamic.

It does this by allowing you to use code to (for example) make a data connection and populate a web page with data from a database or change the html code in the web page based on a user response.

Currently you can use VBScript, JavaScript/JScript, or PERL as your ASP scripting language.

The difference between using VBScript (for example) in ASP and just using it independantly is that by itself, VBScript runs on the client side and is restricted to client side functionality.

Whereas in the context of ASP, your VBScript code will run on the server before the page is served up.

Mechanically, you write ASP code by using html like tags.

The ASP code is surrounded by <% and %>

The following sample code gets information from a database using odbc and displays it in a web page.


<%@ language="vbscript" %>

<%
set ConnObj = Server.CreateObject("ADODB.Connection")
set RstObj = Server.CreateObject("ADODB.Recordset")

ConnObj.open "MyDSN"

strSQL = "select id, deptname from department"

RstObj.Open strSQL, ConnObj,adOpenKeySet,,adCmdTable

%>
<H2>Please select the department budget to view.</H2><br>
<FORM NAME="TEST" ACTION="display.asp" method="post">
<SELECT name="deptno">
<%

RstObj.MoveFirst

do until RstObj.EOF
      response.write("<option value=" & RstObj("id") & ">" & RstObj("deptname"))
      RstObj.MoveNext
loop
%>

</select>
<input type="submit" value="View Budget">
</FORM>

<%
RstObj.close
ConnObj.close
%>



Hopefully this will give you a rudimentary understanding.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question