Click here to Skip to main content
Click here to Skip to main content

Online DB Administration

By , 17 Mar 2003
 
<!-- Download Links --> <!-- Article image -->

Sample Image - netdb.gif

<!-- Add the rest of your HTML here -->

Introduction

This is an application for online administration of your database.

Features

  • Supports MS SQL Server (not completely) and MS Access.
  • Create, modify, and drop tables and views.
  • Create and drop keys (primary, foreign, and unique).
  • Create and drop indexes.
  • Edit, insert, and duplicate rows in tables.
  • Foreign keys are used to create filters/lookups when browsing and editing data.
  • Export tables and views to a CSV file.

Installation

  1. Unzip all files to a directory available from your web server.
  2. Modify config.asp to point to your database.

History

Feb 27 2003

  • Included adojavas.inc since a few seems to have problem with metadata and global.asa.
  • Lots of minor changes and bug fixes.

Mar 18 2003

  • Updated source code.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Bjornar Henden
Web Developer
Norway Norway
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMicrosoft Jet Database Engine (0*80040E14)memberKruthika21-Apr-08 22:40 
Hai,...
I have designed a coding to accept the information from the user(i.e., user Name, staffno and comments) and to store the same input into Access database.But when I clickon sumbit button I am getting the following error:
 
Error type :
Microsoft Jet Database Engine (0*80040E14)
Number of querty values and the desatination feilds are not the same
/report/formreport.asp,Line 29
---------------------------------------------------------------------------------------------------------------------------------------------------------
The coding is shown below
 

 
<html>
<% @LANGUAGE="VBScript" %>
<body>
<%
' Declaring variables
Dim username, userstaffno, usercomments, data_source, con, sql_insert
 
' A Function to check if some field entered by user is empty
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function
 
' Receiving values from Form
username = ChkString(Request.Form("username"))
userstaffno = ChkString(Request.Form("userstaffno"))
usercomments = ChkString(Request.Form("usercomments"))
 

data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &_
Server.MapPath("formreport.mdb")
 
sql_insert = "insert into formreport (username,userstaffno,usercomments)"
sql_insert = sql_insert & " values (' " & Request.Form("username") & " ' , ' " & Request.Form("userstaffno") & " ' , ' " & Request.Form("usercomments") & " ' , ' " & " ' )"

' Creating Connection Object and opening the database
Set con = Server.CreateObject("ADODB.Connection")
con.Open data_source
con.Execute sql_insert

' Done. Close the connection
con.Close
Set con = Nothing
Set sql_insert = Nothing
Response.Write "All records were successfully entered into the database."
%>
</body>
</html>
 

Please help me
Thanks in advance
Generalupdate a databasememberkashmeera25-Dec-06 1:17 
how can i update a database with n no of entries and in a specific column?
eg.students attendance for a specific date is to be updated.
what should be the code? please tell me.
 
kashmira

GeneralCheckSecurity()memberspencersface24-Sep-06 22:14 
Is it possible to bypass the CheckSecurity() function in the config.asp file? I'd prefer to not have my users need to log into my domain to access the database. When I delete the string default.asp doesn't work anymore..
 
Any ideas?
GeneralEditing a row [modified]memberspencersface24-Sep-06 17:08 
This application is excellent!
 
For some reason I can add rows to the table database and yet when I click the "edit," "copy," or "delete" buttons, it simply takes me back to the default.asp page. I have all write persmissions enabled on the folders... any ideas?
 
Thanks!
 
Spencer Big Grin | :-D
 

-- modified at 1:28 Monday 25th September, 2006
 
Nevermind, I figured out that it had to do with the way my database was configured in Access.
 
Thanks though!
QuestionWhat a password?memberssl7799-Jul-06 20:01 
I uploaded project to the server, but when I try to open it in browser the messagebox appears to enter "Username" and "Password".
So, what is the username and password do I have to enter?

Generali need asp notessussshahid abbas30-Aug-05 22:19 
need asp notes for help Sigh | :sigh: please send at shahidonline@yahoo.com
GeneralError on updatememberandymilli6-Feb-05 9:08 
When I try to edit the data in one particular table and save it I get an error:
 
ERRORS!
Multiple-step operation generated errors. Check each status value.
 
Can someone explain what this error means? Other tables work okay, and I can add a new record to this table.
 
Thanks
GeneralPage contains both secure and nonsecure itemsmemberShadowkn19-Feb-04 11:34 
First off, this code is beautiful!!! However, I run the code on a SSL site, ie: https. When doing so, each page gives me the security warning. "This page contains both secure and nonsecure items. Do you want to display the nonsecure items?"
 
I have searched thru the web for hours trying to find a way to disable this message from popping up. Some sites say that the warning could be due to files being called from another nonsecure http site. But, the routine does not have any calls that do this. I have tried adjusting my security settings, even the exact setting that should remove the warning but it does nothing! The message comes up each and every page I go to, HELP!!!! Cry | :((
QuestionCannot add record if table is empty?sussRui Silva 119-Nov-03 4:42 
If a table is empty dbedit shows me 'no Data' and toolbar control doesn't appear.
 
I can not add records.
 

Generalremote administration for this appmemberyanra27-Oct-03 1:27 
good work bjornar! i've learned a lot from your code. btw, it's working when tested locally. what should we change in there so it could be used for remote administration on any computer? It brings out different error(ei unspecified) when accessed on another computer.
 
can we all try to solve this one? thanks!;)
GeneralPls help me...to fix this foreign key problem listbox problemmemberwysste4-Aug-03 18:27 
Ms access 2000 database can function very well with all the primary,foreign, it can work accordingly how is supposed to be, if i use the sql server 7.0 database, primary, foreign key lookup not functioning...eventhough i use the proper northwind sql server sample database for the testing cant able to work with search or lookup or listview, your asp coding is very usefull around south pacific countries, some of my co progrmers friends also aware about this coding, nice job...please help me, this can be very usefull for the beginging stage programmers....
 
Wink | ;)
GeneralResponse object error 'ASP 0156 : 80004005'memberwysste28-Jul-03 17:58 
Response object error 'ASP 0156 : 80004005'
Header Error
/common.asp, line 38
The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.
 
it can run under window 2000, cant able to run windows98, please give me suggestion, how can i use the source code under windows98...help me.
 

 

Generalwindows98,microsoft SQL Server 7.0memberwysste4-Aug-03 18:17 
i am using windows98,microsoft SQL Server 7.0
 
Object.Conn = Server.CreateObject("ADODB.Connection");
Object.Conn.Open(Config("connstr"));
Object.Conn.CursorLocation = adUseClient;
 
PageSetup(); -> remove this function and place the above three line here
NewPageHeader();
Content(Object.Conn);
NewPageFooter();
PageCleanup();
 
stupit process like this no body wants to c ur page...
GeneralJavaScript Runtime errorsmembersimonfunston9-Jul-03 23:20 
Hi, I have a problem using the Online DB Administration tool.
I can connect to the database fine and can view its tables.
When I select a table I can view the records fine, but I when I click on edit a record it simply goes back to the default page.
 
I get the following errors on the bottom of the page:
 
Line 14; Char 66
Error: Expected ';'
Code: 0
 
Line 14; Char 101
Error: Expected ';'
Code: 0
 
Line 14; Char 102
Error: Expected ';'
Code: 0
 

Can anyone help?
 
Thanks
 
Simon
Generalcan't look up the table if use Oraclememberfauzy3-Jun-03 7:13 
When I set config.asp into oracle, then I execute default.asp
but the table didn't list
and when I execute data.asp?table=mytable, then the value of the table is shown but I cant edit, delete or addnew
can you help me please
 
ahmadi al fauzy
Generalerror in config, needs help.membervjkumar14-May-03 9:56 
as suggested, i edited the config pages to point to my data base, and on viewing, gets the following message.
 
Response object error 'ASP 0156 : 80004005'
Header Error
/netdb/common.asp, line 37
The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.
 
any body knows how to solve the problem??
any help will be highly appreciated.
( i saw another user had the same problem, but no replies to it....)
thnx.

 
vjkumar
GeneralEdit disabledmemberMaPi12-May-03 0:28 
Hi,
when try to use your script is possible to change index, add and drop table, modify their structure, but the key for add a new row in table is disabled like there is not the column at the left with the icons for edit delete and copy a record.
In few word the only thing impossible is edit the rows of a table. Frown | :(
Why? (is a config problem?)
 
Thank's
 
MaPi
QuestionHow can I use VBScript to load a BGrid?membercive1em24-Apr-03 9:52 
I have no problem to apply your BGrid in ASP using Javascript. A great package.
However, I couldn't figure out how to use the BGrid class using VBScript. I try the following codes without success. I keep getting this error: "Microsoft VBScript runtime (0x800A01FA) Class not defined: 'BGrid'"
 
What is the correct syntax I should use? Thanks a lot.
 

set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open("DSN=TEST; UID=TEST; PWD=TEST")
Conn.CursorLocation = adUseClient
 
set rs = Server.CreateObject("ADODB.Recordset")
str1 = "SELECT * FROM EMPLOYEE"
rs.Open str1, Conn, adOpenStatic, adLockOptimistic, adCmdText
 
set Grid = new BGrid
Grid rs
Grid.Process
Grid.Display
 

AnswerRe: How can I use VBScript to load a BGrid?membercive1em24-Apr-03 10:11 
Just figure out how it works with VBScript.
 

set Grid = CreateGrid(rs)
Grid.Process
Grid.Display
 


Generalunuseful under .NET, OBSOLETEmemberandré_k21-Mar-03 3:03 
How do you "Online Administer DB" as you pretend in ASP.NET (aspx), with this code please ?
 
As your article is introduced under ASP.NET hierarchy, make an effort and translate it under aspx.

You'll see then that when u use vbscript mixed to javascript to format time, that introduces a 2nd script language and makes impossible to compile your code in ASP.NET !
 
Think it's a piece of museum, an obsolete piece of ASP pages..
Sorry
GeneralRe: unuseful under .NET, OBSOLETEmemberBjornar Henden21-Mar-03 5:47 
Since this code is written for ASP, I don't pretend it does anything under ASP.NET. Wether you run the rest of your web site under ASP.NET is up to you. ASP and ASP.NET runs fine together you know (or at least you should know Smile | :) ).
 
All ASP articles here at CodeProject is under the ASP.NET hierarchy. Does that mean you think all ASP articles here is useless and obsolete? Dead | X|
Generaltrue/false yes/no fieldsmemberBill McGhee4-Mar-03 10:48 
Great app. I guess it will only run on IIS as I could not get it working in PWS.
 
I noticed that it does not support binary field in the table or column create. I've not cracked open the code to see if I can do it myself but I thought this might be a simple mod for you.
 
Cheers and thanks for the great app.

 
bill
GeneralRe: true/false yes/no fieldsmemberBjornar Henden16-Mar-03 22:17 
What database are you running against? I have no problems creating tables with either bit or binary (not sure which type you meant) fields on a MS-SQL database. I didn't test right now on Access, but it should support any datatype the db supports. I check available datatypes through the ProviderType schema.
GeneralRe: true/false yes/no fieldsmemberBill McGhee25-Mar-03 2:36 
Disregard. I was not seeing the 'bit' type in the column create dropdown list. I was looking for 'boolian'
 
bill
GeneralAccess Denied errorsusstvde4-Mar-03 0:13 
Hi !
 
I'm getting an 'access denied' error when trying to access a Microsoft Access database on my hosted website. I uploaded all the files and updated the config.asp file.
 
Anyone any suggestions Confused | :confused: ?
 
Thx,
Tom

GeneralRe: Access Denied errormemberBjornar Henden4-Mar-03 3:43 
You need to have write access to the .mdb file.
GeneralRe: Access Denied errorsusstvde5-Mar-03 21:39 
Bjornar,
 
I'm pretty sure that I have write access as my 'normal' ASP pages are able to update the database...
 
Another suggestion maybe ?
 
Thx,
Tom

GeneralRe: Access Denied errorsussTom Van den Eynde6-Mar-03 21:40 
Hi !
 
It seems to be related to the fact that I'm using anonymous access - when I'm authenticated there's no problem (probably some security setting by my hosting provider). Now I wonder how I can get authenticated even when anonymous access is allowed. Anyone any suggestions ?
 
Thx,
Tom

QuestionADOX constants missing ?susstvde4-Mar-03 0:05 
Bjorn,
 
This is really great stuf Big Grin | :-D !
 
I however ran into some errors Eek! | :eek: (which seem to be related to missing ADOX constants - which indeed are not in your adojavas.inc) :
 
When clicking 'indexes' :
Error Type: Microsoft JScript runtime (0x800A1391) 'adIndexNullsAllow' is undefined /netdb/b.func.asp, line 28
 
When clicking 'keys' :
Error Type: Microsoft JScript runtime (0x800A1391) 'adKeyPrimary' is undefined /netdb/keys.asp, line 29
 
I hope you can help me out !
 
Best regards,
Tom
AnswerRe: ADOX constants missing ?memberBjornar Henden4-Mar-03 3:34 
Modify the file common.asp to look like this in the top:
 

<!--#include file=config.asp-->
<!--#include file=adojavas.inc-->
 
<%
//---- AllowNullsEnum Values ----
var adIndexNullsAllow = 0x00000000;
var adIndexNullsDisallow = 0x00000001;
var adIndexNullsIgnore = 0x00000002;
var adIndexNullsIgnoreAny = 0x00000004
 
//---- KeyTypeEnum Values ----
var adKeyPrimary = 0x00000001;
var adKeyForeign = 0x00000002;
var adKeyUnique = 0x00000003;
 
//---- RuleEnum Values ----
var adRICascade = 0x00000001;
var adRINone = 0x00000000;
var adRISetDefault = 0x00000003;
var adRISetNull = 0x00000002;
%>
 
...

QuestionHow to configmemberwilla3-Mar-03 21:48 
OK so maybe i am being silly but is their any instruction on how to config the config.asp?
 
I want to us it to admin a SQL DB so what info would i need and what lines should i // out?
 
I cant wait to us this maodule.
 
Willa
AnswerRe: How to configmemberBjornar Henden4-Mar-03 3:42 
These two lines are needed to connect to MS-SQL:
 

case 'connstr': return 'Provider=SQLOLEDB.1;User ID=sa; Password=;Initial Catalog=mydb;Data Source=(local)';
case 'database': return 'mydb';

 
where mydb is the name of your database, and (local) is the name of the server where MS-SQL is running. You might need to change User ID and Password also.

GeneralLook up isn't workingmemberswang20-Feb-03 10:43 
The look up does not work. The combo box shows the Foreign Key but when I select and try to go to the next page I get this error.
 
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/HAL/HAL_MAINTENANCE/data.asp, line 88
 

Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)
 

Any help would be appreciated. Using SQL 2000 on Windows 2000.
GeneralRe: Look up isn't workingmemberBjornar Henden20-Feb-03 23:08 
The foreign key must be only one field and that field must be integer. Could this be the problem?
GeneralRe: Look up isn't workingmemberswang21-Feb-03 4:39 
Yes that is the problem. Thanks
GeneralView Schema Feature Not Workingsussdandrade17-Feb-03 10:41 
These schemas are not showing up:
 
Asserts
CharacterSets
Collations
ColumnsDomainUsage
ConstraintColumnUsage
ConstraintTableUsage
 
Cubes
Dimensions
Hierarchies
KeyColumnUsage
Levels
Measures
Members
 
ProcedureColumns
Properties
ProviderSpecific
ReferentialConstraints
SQLLanguages
Translations
Trustees
UsagePrivileges
ViewColumnUsage
Views
ViewTableUsage
 
Maybe it has to do with Provider. I reference database with:
Provider=SQLOLEDB.1;Integrated Security=SSPI;Trusted_Connection=Yes;Data Source=SERVERNAME;Initial Catalog=DATABASENAME;
 
Is there a better provider for referencing MS SQL Server 7 and 2000
 
Thanks.
 

 

GeneralRe: View Schema Feature Not WorkingmemberBjornar Henden20-Feb-03 23:03 
There are no better providers that I know. Guess you could try to go via ODBC, but I doubt that would help Smile | :)
 
Doesn't have to be the provider either, since all databases might not support all shcemas defined in ADO.
QuestionVery nicely done - 2 errors, any fixes?memberNellie446914-Feb-03 4:40 
A really nicely developed app - well done!
 
I have found two errors, both of which have been mentioned in the forum - Missbean and Annonymus on the 12/12/2002 and 17/12/2002.
 
Are there any fixes available?
 
Nellie
AnswerRe: Very nicely done - 2 errors, any fixes?memberBjornar Henden15-Feb-03 0:19 
The link to table_info.asp shouldn't be there.
 
The error message from Annonymus I have no fix for.
GeneralRe: Very nicely done - 2 errors, any fixes?memberNellie446915-Feb-03 7:35 
Thank you for your response, any idea what is causing the error, when trying to save an edited record?
 
Nellie
Generalerror with Windows NT and mdbsussamitupadhyay3-Feb-03 0:23 
I had changed the database file in config file as told to do so.Also the mdb file is the one from one of the code project source code.iam using winnt and IIS 4.0.Wat should i do , most codes from here i am getting an error
error is :
Response object error 'ASP 0156 : 80004005'
 
Header Error
 
/trial/tabeditor/common.asp, line 25
 
The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.
 
PLZZZZZZZZZZ HELP ME , IAM INTO A PROJECT AND NEED THISCry | :((
 
Amit Upadhyay
GeneralHelp pleasemembercog16-Jan-03 20:50 
I encounter the following error. Cry | :((
 
ADODB.Connection (0x800A0CB3)
Object or provider is not capable of performing requested operation.
/admin/Default.asp, line 25
 
I'm trying to connect using DSN since the database is on another server. Any help would be greatly appreciated.
GeneralRe: Help pleasememberBjornar Henden19-Jan-03 8:09 
Only Access and MS SQL are supported, and only through OleDb. Sounds to me like you are using ODBC, or a different database.
GeneralMissing ado constantsmembersmorley16-Jan-03 6:02 
The only problem that I'm getting is that none of the ado constants are defined. I'm running this on a WinXP system on which I primarily do ASP maint. Is there some config setting which makes the ado constants available to the scripts. I usually need to include adovbs.inc if I want these values available for VB Scripts.
GeneralRe: Missing ado constantsmembersmorley16-Jan-03 6:29 
Answered my own question.
 
Forgot to move the METADATA stuff to the active global.asa.
 
Also needed to update for ADO2.7
<!-- METADATA NAME="Microsoft ActiveX Data Objects 2.7 Library"
TYPE="TypeLib" UUID="{EF53050B-882E-4776-B643-EDA472E8E3F2}" -->
 
Here's some info on METADATA if your so interested: http://www.atgconsulting.com/adotypelibs.asp
 

GeneralOutstanding !memberSw_writer16-Jan-03 1:00 
The install took < 60 seconds (made an application in IIS, changed provider string) and it was up & running!
 
I'm impressed.
 
Nice work. Smile | :)
Generalwill dbadmin work w/ PWS? getting errormemberBill McGhee8-Jan-03 4:56 
All I have changed is the config to point to test.mdb (in the same dir). Getting this.
 
Response object error 'ASP 0156 : 80004005'
Header Error
/dbadmin/common.asp, line 25
 
The HTTP headers are already written to the client...
 
If I remove lines 25 and 26 I get:
 
Microsoft JScript runtime error '800a1391'
 
'adUseClient' is undefined
 
/dbadmin/common.asp, line 30
 
I have the properties in PWS set to Execute for this dir but I am not sure tht is the same as an IIS application.
 

 

 
bill
GeneralCan't run Online DB Administrationmembertnh28-Dec-02 5:24 
I Can't run Online DB Administration well, it cause some errors that in source file wrote.
So can you help me ?
GeneralDB GridmemberSwanger18-Dec-02 9:59 
Got it to work and bring up all my tables in the Database but why can I add, edit and delete from some tables and not from others? Is it a setting in the code or is it my database? Using SQL 2000 on Windows 2000 server. Thanks for any help.
 

 
Swanger
Generalhelp I got an error messagesussannoymus17-Dec-02 7:42 
Please i got a table with two foreign key
on using data.asp?table=xxx
where xx is my table name on clicking the edit button
the edit screen pop up nicely but on clicking the save button
i received the following error message
 
Multiple-step operation generated errors. Check each status value.
 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130617.1 | Last Updated 18 Mar 2003
Article Copyright 2002 by Bjornar Henden
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid