• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 321
  • Last Modified:

Export to Access Database from ASP

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
dpwdc
Asked:
dpwdc
  • 8
  • 6
  • 5
  • +3
1 Solution
 
arbertCommented:
What kind of data????  You can use ADO, ODBC, OLEDB....

Brett
0
 
dpwdcAuthor Commented:
just generic csv text type data.  simply want to export as an access mdb rather than as a csv.
0
 
arbertCommented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
dpwdcAuthor Commented:
damn, i was hoping to avoid having to HEX things.
0
 
arbertCommented:
Did you want a totally automated solution?

0
 
dpwdcAuthor Commented:
Besically.  Wanted something that would churn out an Access file in the same way a CSV can be churned out.
0
 
MaxOvrdrv2Commented:
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
 
apolloisCommented:
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
 
MaxOvrdrv2Commented:
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
 
arbertCommented:
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
 
jSkipBCommented:
There is a way, using DAO - but it ain't pretty.
0
 
dpwdcAuthor Commented:
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
 
arbertCommented:
I thought your original question was how to convert CSV on a webpage?????
0
 
apolloisCommented:
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
 
apolloisCommented:
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
 
arbertCommented:
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
 
apolloisCommented:
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
 
apolloisCommented:
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
 
arbertCommented:
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
 
dpwdcAuthor Commented:
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
 
apolloisCommented:
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
 
arbertCommented:
What's the status on this question?

Brett
0
 
GaryCommented:
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

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 8
  • 6
  • 5
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now