?
Solved

Export to Access Database from ASP

Posted on 2003-03-24
23
Medium Priority
?
319 Views
Last Modified: 2008-02-01
Hi,

Heres the brief,
ASP page with data on it, can export to CSV etc, but I want to export the data as an Access Database.  Anyone know if this is possible?

D
0
Comment
Question by:dpwdc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 6
  • 5
  • +3
23 Comments
 
LVL 34

Expert Comment

by:arbert
ID: 8196225
What kind of data????  You can use ADO, ODBC, OLEDB....

Brett
0
 
LVL 1

Author Comment

by:dpwdc
ID: 8196268
just generic csv text type data.  simply want to export as an access mdb rather than as a csv.
0
 
LVL 34

Expert Comment

by:arbert
ID: 8196412
Ya, there's not really and export.  You would have to open a recordset and basically do SQL Inserts using the data you get from the html document.

Brett
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Comment

by:dpwdc
ID: 8196607
damn, i was hoping to avoid having to HEX things.
0
 
LVL 34

Expert Comment

by:arbert
ID: 8196628
Did you want a totally automated solution?

0
 
LVL 1

Author Comment

by:dpwdc
ID: 8196649
Besically.  Wanted something that would churn out an Access file in the same way a CSV can be churned out.
0
 
LVL 10

Expert Comment

by:MaxOvrdrv2
ID: 8197515
i think it's actualyl possible... give me like 5 minutes... i remember seeing something about GENERATING a Access Database from ASP...

Let me get back to you...

MaxOvrdrv2
0
 
LVL 10

Expert Comment

by:apollois
ID: 8197553
Hi dpwdc,

Let's start with what form is your source data in?  Please give an example.

If you have created an Access DB using Access, and copy it to your Web server, it is simple enough to add records to it.

If you want to create the Access DB from ASP, that's going to be a lot more difficult.  Best to not go down that path unless you absolutely have to.

Best Regards,
>apollois<
0
 
LVL 10

Expert Comment

by:MaxOvrdrv2
ID: 8197678
it is possible.. but as apollo said... it is very complicated... so let us know if you absolutely NEED to be CREATING an Access Database in ASP...

Thanks!

Maxovrdrv2
0
 
LVL 34

Expert Comment

by:arbert
ID: 8197729
Well, ya it's easy enough to generate an Access database from asp (like I said earlier), but you can't simply take a CSV file from asp and say bam you're a database--you need to create the insert statements to enter the data....
0
 
LVL 3

Expert Comment

by:jSkipB
ID: 8205902
There is a way, using DAO - but it ain't pretty.
0
 
LVL 1

Author Comment

by:dpwdc
ID: 8208995
Idea is someone uploads their Access DB to a site, data is validated, good data sent back as a clean Acess DB.  Ho hum
0
 
LVL 34

Expert Comment

by:arbert
ID: 8210894
I thought your original question was how to convert CSV on a webpage?????
0
 
LVL 10

Expert Comment

by:apollois
ID: 8212571
dpwdc,

>>> Idea is someone uploads their Access DB to a site, data is validated, good data sent back as a clean Acess DB.  Ho hum <<<

The easiest way is to copy the Access DB file using FSO.  Then edit the copy using ADO.  You could then even EMail the validated/cleaned copy back to the user using CDONTS or CDOSYS.

Any questions?

Best Regards,
>apollois<
0
 
LVL 10

Expert Comment

by:apollois
ID: 8212595
arbert,

Here's how you copy a file using FSO:

=======================================
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

objFSO.CopyFile "C:\InetPub\wwwroot\DB\Original.mdb","C:\InetPub\wwwroot\DB\Copy.mdb"

Set objFSO = Nothing
======================================

Best Regards,
>apollois<
0
 
LVL 34

Expert Comment

by:arbert
ID: 8212627
I know how to copy a file using FSO--I didn't ask any questions.....My comment was, this guy in his first question was asking about exportin CSV files from a webpage to an Access database, now in the last question we're talking about uploading and access database and validating the data and sending it back....

Which question do you want answered????

Brett
0
 
LVL 10

Expert Comment

by:apollois
ID: 8212681
arbert,

Sorry arbert, I addressed my post to the wrong person.

Original Question:
>>> ASP page with data on it, can export to CSV etc, but I want to export the data as an Access Database. <<<

dpwdc did not state the source of the data in the ASP, but he/she clearly wants to output to an Access DB.  In one of my previous posts, I asked what is the source, and the reply is an Access DB.  So, it's Access DB =====> Access DB.

Rather than try to create a new DB from ADO (difficult), I suggested that he/she simply copy the original, and then verify/cleanup the copy.

Best Regards,
>apollois<
0
 
LVL 10

Expert Comment

by:apollois
ID: 8212703
dpwdc,

Here are some complete examples showing how to display data from your DB in a HTML form, get the changes submitted by the web user, and then update your DB with the changes.  After you copy the source DB, you can verify/clean using the approaches shown below.

Write to a Database Using SQL and ASP
http://gethelp.devx.com/techtips/asp_pro/10min/10min1299/10min1299.asp

Updating Records to a Database using ADO(ActiveX Data Objects)
http://www.intranetjournal.com/articles/200002/wd_02_25_00dd.html

Adding Records to a Database using SQL
http://www.intranetjournal.com/articles/200002/wd_02_25_00ee.html

To get the Primary Key of the record you just INSERTed, see the following:
http://www.kamath.com/tutorials/tut007_identity.asp

Fill your pulldowns with data from a Database!
http://www.asp101.com/samples/db_pulldown.asp

Modify a pulldown's options based on other input.
http://www.asp101.com/samples/db_pulldown_linked.asp

Perform a simple text search on a database.
http://www.asp101.com/samples/db_search.asp

Feel free to post followup questions if you have any specific questions about any of these examples.

Best Regards,
>apollois<
0
 
LVL 34

Expert Comment

by:arbert
ID: 8212823
Well he doesn't know what he want then.

Above, I asked:

"What kind of data????  You can use ADO, ODBC, OLEDB...."

and he replied AGAIN:

"just generic csv text type data.  simply want to export as an access mdb rather than as a csv.  "
0
 
LVL 1

Author Comment

by:dpwdc
ID: 8278561
please READ the question before coments like "Well he doesn't know what he want then." AND as I said

"just generic csv text type data.  simply want to export as an access mdb rather than as a csv.  "

The data I am working with isn't frig*ing important, the question I asked in the 1st place is regarding the EXPORT, not the IMPORT, processing etc.  done that part:

"ASP page with data on it, can export to CSV etc, but I want to export the data as an Access Database.  Anyone know if this is possible?"

CAN EXPORT TO CSV - I CAN DO THAT!, CAN!, NOT WANT TO, !*CAN*!  EXPORTING AS CSV IS NOT WHAT I WANT AS I SAID IN THE 1ST PLACE!!

I want to EXPORT, I emphesise, EXPORT data as an access file that is GENERATED.  Not inserted into an existing access DB, I want to create Access DB's on the fly.
0
 
LVL 10

Accepted Solution

by:
apollois earned 1000 total points
ID: 8279717
dpwdc,

>>>  I want to create Access DB's on the fly <<<

OK, this should do it:

Create an MS Access database by ASP VBScript
http://freehost26.websamba.com/zhanshan2002/asp/dbcreatesql.html


Best Regards,
>apollois<
0
 
LVL 34

Expert Comment

by:arbert
ID: 8711522
What's the status on this question?

Brett
0
 
LVL 58

Expert Comment

by:Gary
ID: 9313070
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Answer by apollois

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question