New Table via ASP?

C

chris leeds

I've googled quite a bit. there is lots of information on adding data to a
table in an .mdb, but what I'm looking for is an example on how to actually
add a new table itself using asp into an .mdb. the table only needs one
column and row.

If anyone knows of a tutorial or example that shows how to create a new
table within and mdb using asp I'd sure appreciate the link.

TIA

In other words, instead of adding rows for content into a table I want to
add tables themselves to hold the content.



--
The email address on this posting is a "black hole". I got tired of all the
spam.
Please feel free to contact me here:
http://nedp.net/contact/
--
 
T

Thomas A. Rowe

In IE Address bar type (default MSN Search):

? ASP Create table Access

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
J

Jack Brewster

chris,

Have you used SQL to create a table before? I know that Access has
some...differences...with standard SQL, but you should be able to create an
SQL statement that will build a table.

CREATE TABLE test
(
test_id int,
test_value varchar(50)
)

Here's a page that provides details and syntax for CREATE statements
http://www.w3schools.com/sql/sql_create.asp

I didn't create the table from an asp page, I did it from within Access
itself, but it should work just as well.
 
C

chris leeds

like I said, I've been googling on it. the only reason I posted the
question was because I'd hoped someone would have come across something that
they personally felt was a good resource.

Thanks.
 
B

Bob Lehmann

www.aspfaq.com

Bob Lehmann

chris leeds said:
like I said, I've been googling on it. the only reason I posted the
question was because I'd hoped someone would have come across something that
they personally felt was a good resource.

Thanks.

--
The email address on this posting is a "black hole". I got tired of all the
spam.
Please feel free to contact me here:
http://nedp.net/contact/
 
K

Kevin Spencer

This would be done using a custom query. The SQL language has a "CREATE
TABLE" statement which creates (amazing!) a table. The exact syntax depends
upon your database product.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
C

chris leeds

thank you Kevin, Jack, and Bob.
at least I'm on the right track.

it would be ridiculous of me to imagine that there'd be an exact example of
what I want to do.

your posts have confirmed my suspicions that it could be done and my google
(before posting) yielded some good links to similar things in action.

btw, the reason I want to do it this way is because of the FrontPage insert
database results function. ;-)
 
T

Thomas A. Rowe

Chris,

Here is example of what I have used:

<%
Dim DSN_Name
DSN_Name = Application("database_ConnectionString")
set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open DSN_Name

Connection.Execute "CREATE TABLE Area (CodeID text(10))"
Connection.Execute "ALTER TABLE Area ADD COLUMN Active text(1)"
Connection.Execute "ALTER TABLE Area ADD COLUMN LinkPoint text(1)"
Connection.Execute "ALTER TABLE Area ADD COLUMN MerchID text(10)"
Connection.Execute "ALTER TABLE Area ADD COLUMN ARC text(10)"
Connection.Execute "ALTER TABLE Area ADD COLUMN About memo"
%>


Note:
The number in text(1) set the field size

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
T

Thomas A. Rowe

What is the issue with how FP creates the database?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
K

Kevin Spencer

If you will tell us what database you're using, I can help you with the
syntax.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
C

chris leeds

with the insert/ database results fp will create a query for everything but
just write the part you select to the pae. if each is a different table
they'll be in the dropdown.
 
T

Thomas A. Rowe

What is "pae" ?

You have to custom code if you want to write to multiple tables.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
C

chris leeds

thank you so much Kevin,
I'll add that to my folder of favorites regarding this idea. I really do
appreciate the extra time you to give me that link. I wonder why I didn't
find it myself.

thanks again,
chris
 
K

Kevin Spencer

Don't wonder why you didn't find it yourself, chris. It's not easy! I found
it several years ago and made a note of it.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top