Creating a simple webpage to display data in SQL Server 2000

  • I want to create a webpage that will allow users to run a sql select command against SLQ Server 2000 and the display the results. I do not have any of the reporting services available to me.

    Any advice is appreciated.

    Thanks.

  • Make sure you lookup SQL Injection before releasing any web page that allows this.

    Do you want to provide "drag and drop" type functionality to select tables and fields or just allow the users to type a query?

  • I basically want the user to enter 4 inputs on the page. Based on the inputs, the sql query will be constructed.

    For example: The page will have 4 input fields. Behind the scenes, there will be some code that inserts those inputs into the sql statement. Like: select + input1 from atable where afield = input2....

    The results will then be displayed in a table on the page.

    Here's the example page:

    Thanks.

  • For some reason I cannot see the image you have embedded. Could you try attaching it?

    Are the 4 inputs all columns in a table or are will they be columns and table(s)?

  • This would be simple enough to do, but can be implemented many ways. What is your server side technology? ASP.Net, PHP, etc?

  • The webpage will be in IIS6.0. With ASP.

    I dont know why the jpg isnt showing. I can see it on my end.

    But the format of the page is:

    FIELD _______

    FEILD _______

    FEILD _______

    SUBMIT BUTTON

    Thanks.

  • Attached is a very simple web form that will do what you want. For simplicity, I have not sanitized the data the user may type in. You should validate for data type, illegal characters, etc. or you risk someone having their way with your database.

  • Thanks!..but I cant view the aspx file. I get:

    The XML page cannot be displayed

    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

    --------------------------------------------------------------------------------

    A name was started with an invalid character. Error processing resource 'file:///C:/TEMP/SQLquery.xml'. Line 1, Position 2

    -^

  • I attached it as an example, you must save it to your pc and open it with notepad or a text editor. If you just open it, it will try to run which can't work unless the file is on a web server and has a valid connection string for the database I used to create the example.

  • Thanks.

    I am going though and discovering that the file is done is C#.

    What IDE did you use to create the page? I am wanting to write in VBScript or JavaScript. Which is easier to do what I want?

    Thanks.

  • I am using Visual Studio. You can get the Express Editions for free in either VB.Net or C#. http://www.microsoft.com/express/download/

    It is easier to use VB.Net than javascript, especially since the server side code can't be javascript. Stick with VB.Net on the client and server for simplicity. I didn't write a single line of code in the example I posted. It was 100% drag, drop and click.

  • Thanks Bob,

    I used MyEclispe to create the html and jsp page. It's working.

    Thanks.

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply