SQL query from webpage
Posted on 2004-10-28
I've been looking into this and I am not sure what path I need to be going down. I would like to take some basic SQL queries that I have and put them onto a webpage and just access them from there instead of using SQL Query Analyzer.
The database is SQL 2000 on a Win2k server. This place is littered with Windows servers, so I can easily host the page on an IIS server.
I am not sure if it's possible, but I would like to do the queries without having to use PERL or PHP. While I like both of them (and have built webpages using both), it would be nice to not have to install anything on the server to accomplish this. Not sure if there is something within ODBC or osql that can be used instead. I know that you can just query strings for osql and I also read some stuff about passing parameters to Stored Procedures. To many options was hurting my brain.
I do have a few queries that are static and will not need to change any parameters, but in most I will need to change a few parameters like username and database.
Sample queries that I would like to put on the webpage:
SELECT Date_Time, Port, Duration, URL
FROM INCOMING, User_Names
Where User_Names.User_ID = Incoming.User_ID and
(User_Names.User_Full_Name = 'Jones, Tom')
order by Date_Time
In that query I regularly need to change the database being used, and the first and last name of the user. I figure these will be added to a form field or something in the page.
I think I have included all the information that I needed too. Please let me know if I forgot anything or I am not making any sense.
Thanks in advance for the help!
PS: I probably will not get a chance to check responses until morning if anyone gets to this tonight.