ADOX: Add tables to your database using ASP Add tables to your database on the fly by using asp and ADOX. Active X Data Objects Extensions
Device Drivers
DirectX
VBrun Files
By Peripheral:


All Drivers
Dll Search
Download Dll Files
Enter The Dll Name:
Paco's Screensaver
Download The Official Paco's Drivers Screensaver.
Check It Out
Computer Maintenance
File Systems
Hardware
Over Clocking
Registry
Surf 2X Faster
Desktop Enhancements
Anime
Icons
Screensavers
Themes
Site Search:

Free Software
Anti-Virus
Audio Tools
E-Mail Clients
Firewalls
Graphic Editors
Web Development
ASP/VBScript
CGI Script
HTML
JavaScript
Paco's Own Scripts
Webmasters Tools
A real easy way to add tables: ADOX
 Recently I had a need to add a table to an Access database. My first inclination was to open Microsoft Access and simply add the table. I pulled a copy of the database from the server. While proceeding to do so, it dawned on me. What if I build this table and upload the amended database to the server, and someone has entered data while I was working on it? Well, not wanting to lose any information that a user could have entered while I was adding my table. I immediately began looking for a better way. ADOX (Active X Data Objects Extensions) was the answer. 

 Using ADOX, I was able to add a table to my database without the risk of losing any data after overwriting the original copy. Here's what happens. You determine what you want in the table and then put that information into an ASP and call it one time. That's it, your table is built. 

 It may take a little while to set up the page, but you don't have to worry about the possibility of losing any data that may be input into the other tables.

Here's How It's Done
In this case we will assume you need a table that has four fields that will house the data from a form. This form will extract a name, email address, comments, and geographical region from users on your site. 

First lets start with a connection. I use a DSN-LESS connection here, but it's up to you.

<%
Set adConn = Server.CreateObject("ADODB.Connection")
Set adRS = Server.CreateObject("ADODB.RecordSet")
adPath = "E:/the/path/to/your/database.mdb"
adConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & adPath & ";"
%>


Next comes the SQL work. Here's where we actually do the work.

<%
adSQL = "CREATE TABLE newtbl (Name text (50), Email text (75), Comments text (255), Region text (50))"
%>


And we execute the SQL statement now.

<%
adConn.Execute adSQL
%>

Of course we close everything.

<%
adConn.Close
Set adConn = Nothing
%>
Search The Web Using Paco's MetaSearch
  
any   all   phrase
 Google     About     Factmonster
 AlltheWeb     MSN     Yahooligans
Stop Popups
Paco's Popup Plucker.
Eliminate those pesky popups!
Paco's Online

Send this page to a friend
Report Broken Links
Hosted By
ChamberGates

Best Viewed At 1024 X 768 Or Higher
Copyright Paco's Drivers © 1996-. All Rights Reserved.