codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:



Home » ASP » Article

ASP SQL Display Queries in a Web Interface

Article by:  Jeff Anderson  ( 1362 ) (2/19/2003)
Bookmark us now! Add to Favourites
Email a friend!Tell a friend
Sponsored by: FindMyHosting - Web Hosting Search
Summary: Instant access for developers to an Access or SQL database via a simple web interface. The interface can be used to run any queries including building tables, updating data and so on.
Viewed: 32492 times Rating (37 votes): 
 4.3 out of 5
 Rate this Article  Read Comments  Post Comments

ASP SQL Display Queries in a Web Interface

Rated:
by Aspin.com users
What do you think?


As a database web developer, there is often a problem getting direct access to the database data - if it's an Access database, the only way is to download the .mdb file, make ammendments and then upload it again (often annoyingly resetting write permissions in the process.) SQL Server has the excellent query analyser, but you may be away from the server, without access to Enterprise Manager, or over a slow connection that would take logging in half an age.



That's where our Query Displayer saves the day. This piece of code is a neat way for you to access your data via the web. It's great for developers comfortable with SQL language to quickly and easily view or modify data in the database, without any software other than a standard browser.

One word of warning - anyone stumbling across this page could delete your entire database, so make sure you put it behind a secure password.

The script is ready to run, you'll need to add your odbc connection string, that's all.

Select All Code







CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
Rate this article:     Poor Excellent
View highlighted Comments
User Comments on 'ASP SQL Display Queries in a Web Interface'
Posted by :  Archive Import (Alastair Graham) at 13:04 on Wednesday, March 05, 2003
BRUJAH fellow coders,

this is a nice piece of code, isn't it!!
Posted by :  Archive Import (goevan) at 14:11 on Thursday, April 03, 2003
This is bad ass!!! Thank you so much!!!
Posted by :  Archive Import (goevan) at 14:11 on Thursday, April 03, 2003
bam! up in 2.5 minutes!!!
Posted by :  Archive Import (box) at 22:24 on Sunday, April 27, 2003
oh thank you. thank you. so simple. so useful. so required.

oYo -- public bicycle.
Posted by :  Archive Import (Jeff) at 13:18 on Monday, April 28, 2003
Doesn't work for me!

Response object error 'ASP 0156 : 80004005'

Header Error

/csc/ShowQuery.asp, line 16

The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.
Posted by :  Archive Import (david) at 02:35 on Tuesday, April 29, 2003
Hi Jeff- you need to set response.buffer=true at the beginning of the page that should solve it
Posted by :  Archive Import (Simon) at 04:43 on Tuesday, May 27, 2003
Hey !! It's doesn't work for me too.

Microsoft OLE DB Provider for ODBC Drivers '0x80004005'

[MERANT][ODBC Oracle 8 driver]Optional feature not implemented.
line: 16
Posted by :  Archive Import (Kumaran) at 11:24 on Monday, June 02, 2003
Great Coding, I have some script already but thanks for sharing....


KlassiCs
Posted by :  Archive Import (Michael Elfassy) at 17:23 on Tuesday, June 03, 2003
YOU RULE! I WANT TO KISS YOU! (joke)

thanks for some great coding!!!!!
Posted by :  Archive Import (Jorge Segarra-Rovira) at 10:27 on Tuesday, July 01, 2003
I keep getting the following error, anyone help me out?

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/jtest/Query.asp, line 38

The database is located in fpdb/testform3.mdb and in the customizing of code i put "dsn=fpdb/testform3.mdb", I've tried all sorts of changing around only to get same error. Anyone help me out?
Posted by :  Archive Import (Jorge Segarra-Rovira) at 15:14 on Tuesday, July 01, 2003
Thanks to a friend changing around some code, specifically:

<%
Sub ShowStructure()
dim objConn,objRs
dim fld,totrec
set objConn=server.CreateObject("ADODB.Connection")
set objRs=server.CreateObject("ADODB.Recordset")
strCon = "DBQ=" & Server.Mappath("fpdb/testform3.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"

'edit this line with your odbc connection details (can be access or SQL server)
objConn.Open strCon
'objConn.Open strCon

**note: instead of dsn he went with dbq and stated specific driver

Now this code works very nicely, thank you Jeff!
Posted by :  Archive Import (Paul) at 15:49 on Monday, July 07, 2003
cool code. Thanks
Posted by :  Archive Import (Parth) at 06:05 on Thursday, July 31, 2003
Hello Friends,
This code is really very good.
But my problem is different. I have created one local web in my office. In that I have created date wise reports. In date wise report user can view their data bye entering starting date to ending date. For that they have to enter dates. So I accept dates from user and used SQL query for between dates. but its not working.
So any body have better suggestion for this problem …..
Posted by :  Archive Import (Tushar Mago) at 01:59 on Friday, August 01, 2003
Thanks, a lot for this great script!
Posted by :  Archive Import (sami) at 03:24 on Tuesday, September 09, 2003
thank you ,
that`s good
Posted by :  Archive Import (anand ) at 12:07 on Thursday, September 18, 2003
I am new to databases. So please can anyone tell how to do the whole thing, that is where to upload the ASP code and how to add the ODBC connection string. If you can send me a step by step procedure, it will be very helpful to me. Looking forward to hear from you ppl.

regards,
anand
Posted by :  pathak at 00:58 on Wednesday, March 03, 2004
i have this problem that i havent been able to solve for almost a week now.....
i am designing this SQL server backend & ASP frontend software....
how do i update several fields at a time concurrently from the ASP??? the update query needs a primary key for the row to be selected but that primary key is being generated by SQL server as a counter.....so i am just defining the variable where this primary key is being stored. <%=rs(call_id))%> call_id being 1,2,3... upon generation

how do i select attributes pertaining to a particular call_id so that i make changes in that row upon pressing the save button?
Posted by :  jkarthik2k1 at 00:29 on Friday, June 01, 2007
Wow this is the code i was looking for.......great help.......thanks a ton


To post comments you need to become a member. If you are already a member, please log in .

 



RELATED ARTICLES
ASP Format Date and Time Script
by Jeff Anderson
An ASP script showing the variety of date and time formats possible using the FormatDateTime Function.
ASP FilesystemObject
by Jeff Anderson
An introduction to the Filesystemobject
Email validation using Regular Expression
by Jeff Anderson
Using regular expression syntax is an exellent way to thoroughly validate an email. It's possible in ASP.
Creating a Dynamic Reports using ASP and Excel
by Jeff Anderson
A simple way to generate Excel reports from a database using Excel.
Create an ASP SQL Stored Procedure
by Jeff Anderson
A beginners guide to setting up a stored procedure in SQL server and calling it from an ASP page.
Creating an SQL Trigger
by Jeff Anderson
A beginners guide to creating a Trigger in SQL Server
ASP Shopping Cart
by CodeToad Plus!
Complete source code and demo database(Access, though SQL compatible) to an ASP database driven e-commerce shopping basket, taking the user through from product selection to checkout. Available to CodeToad Plus! Members
Concatenate strings in sql
by Jeff Anderson
A brief introduction to concatenating strings in an sql query (using SQL server or access databases).
ASP OpenTextFile
by Jeff Anderson
An introduction to the OpenTextFile Method of the FileSystemObject
The asp:checkbox and asp:checkboxlist control
by David Sussman, et al
Checkboxes are similar to radio buttons, and in HTML, they were used to allow multiple choices from a group of buttons.








Recent Forum Threads
• hidden div block when displayed, displays at an offset of 200px only in IE 6..
• help - sketch
• Re: Perl Script - File Handling.
• Open a file from website
• Re: to open 5 terminals from one and also execute different commands on each terminal
• read a selected multiple line, those should match some of the values read in the files..
• Help me please
• Empty the contents of a file.
• Month Start, End dates


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008