Excel and MDB

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/68113?pagenum=1
05 November 2025, 03:32

Topic


kolucoms6
Excel and MDB
20 January 2009, 18:57



I am looking for ASP Code to Upload Excel/Tab/CSV file to MDB db.
Now catch is header in Excel/Tab/CSV are not fixed and everytime I get file, it changes.
I am looking for ASP code which will allow me to match fields of Excel/Tab/CSV with MDB and then click on submit and it will upload data to MDB.
Any available ?<

 

Replies ...


Carefree
20 January 2009, 20:35


If you have Access, simply open it and import from the spreadsheet. Otherwise, to do it from a webpage, I'll have to do some digging. I think I have something that'll do it, but no clue where I stashed it.<
gary b
20 January 2009, 20:56


kolucoms6
21 January 2009, 06:35


Here is the sample which i am looking at :

http://prodsurvey.webng.com/custom.JPG

I hope it helps in understanding.
Left hand side shows Database field and right side shows Field from excel which I can select.
I can do the mapping and submit data and it will upload all data<
Carefree
21 January 2009, 09:19


This may help:

Edit: code deleted, faulty. See below.
Save it as "import.asp" and give it a try.<
kolucoms6
21 January 2009, 10:04


I will give it a try but any way i can select Excel from the Local Harddisk ?
I have the same in PHP but need it in ASP.<
Carefree
21 January 2009, 10:37


Is the Access DB stored remotely and the Excel spreadsheet stored locally? I don't think that's possible, someone else may know differently. I changed the variables in the code to match your example. You cannot use spaces in the field names, change them to underscores.<
Carefree
21 January 2009, 10:57


Carefree
21 January 2009, 12:00


One other issue you may encounter is related to differing iusr_(machinename) accounts and passwords. You may have to add a specific username/pw (with a DSN name) that match on both systems. I think it'll be more trouble than it's worth. You may be better off adding a FTP account to the server (with known path), uploading your spreadsheets and using the direct path method.<
kolucoms6
21 January 2009, 12:16


I need to give this Option to my user.<
kolucoms6
22 January 2009, 15:59


Its like :

1) Read all fields from a Table( can be hardcoded in the asp code ) and display on the left side. 2) Read all headers/first row from Excel and fill it in an array. 3) On left side column, Next to each field name form table, display a dropdown box with each excel first row value. 4) On submission of the form, code upload data in respective selected fields.

<
Carefree
22 January 2009, 17:36


OK, that's a bit more work, but it can be done. I'll try and write that tonight sometime.<
kolucoms6
25 January 2009, 13:30


Sorry for bumping it up... Any Code will definitely be a help<
Carefree
25 January 2009, 13:35


I about have it done - but now I have a high priority thing to finish today. I'll see about finishing it tonight.<
kolucoms6
28 January 2009, 13:53


Ok<
Carefree
28 January 2009, 15:38


© 2000-2021 Snitz™ Communications