chris_angell
03-06-2007, 12:09 PM
Hi guys I am trying to upload an excel spread sheet, read the information from this and then convert all this information into an asp database.
I have the main concept on how to open read, add info in MS Access, but i am a little confused on how to read the excel info (ie how many fields and then create these in ms access).. if you know any links that will be good.. my knowledge on create new fields via SQL in minimal..
this is how i think i can do it..
upload my file, take the name and then
Set objExcel = Server.CreateObject("Excel.Application")
objExcel.Workbooks.Open "DRIVER={Microsoft Excel Driver (*.xls)};DBQ= " & Server.MapPath('" & my excel file & "')
i am not to sure how to determine how many fields are in ?? any ideas on this...
once i have done this create these in asp ms access
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ= " & Server.MapPath('" & my access bd & "')
HOW DO I CREATE FIELDS ???
Once i have created both, i take it i can loop through the excel and then add to the access... ie
While not objRecords.EOF
objExcel.ActiveSheet.Range("name" & i).Value = Recordset("ID")
i = i + 1
Wend
after this save
close connections and update..
but i am just stuck on filding the excel info and creating new fields in ms access??
any help would be great
many thaks chris
I have the main concept on how to open read, add info in MS Access, but i am a little confused on how to read the excel info (ie how many fields and then create these in ms access).. if you know any links that will be good.. my knowledge on create new fields via SQL in minimal..
this is how i think i can do it..
upload my file, take the name and then
Set objExcel = Server.CreateObject("Excel.Application")
objExcel.Workbooks.Open "DRIVER={Microsoft Excel Driver (*.xls)};DBQ= " & Server.MapPath('" & my excel file & "')
i am not to sure how to determine how many fields are in ?? any ideas on this...
once i have done this create these in asp ms access
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ= " & Server.MapPath('" & my access bd & "')
HOW DO I CREATE FIELDS ???
Once i have created both, i take it i can loop through the excel and then add to the access... ie
While not objRecords.EOF
objExcel.ActiveSheet.Range("name" & i).Value = Recordset("ID")
i = i + 1
Wend
after this save
close connections and update..
but i am just stuck on filding the excel info and creating new fields in ms access??
any help would be great
many thaks chris