ASP connection to .xls

I am trying to insert excel data into an access database. The code below works perfectly for me even though it gives me access denied after successful upload.

<% Set cn = CreateObject("ADODB.Connection")

'scn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\docs\dbto.mdb"

MMNDC2016STRING = " Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & Server.MapPath("data/dbase.mdb")

cn.Open MMNDC2016STRING

sSQL = "INSERT INTO ElectionResults SELECT * FROM " sSQL = sSQL & "[Excel 8.0;HDR=YES;IMEX=2;DATABASE=C:\inetpub\wwwroot\election\Data\ataupload.xls].[Sheet1$]"

cn.Execute sSQL, recs

MsgBox recs %>

However, when i upload it online it does not work. I noticed is the connection from the Excel. I edited it to this way

<% Set cn = Server.CreateObject("ADODB.Connection")

'scn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\docs\dbto.mdb"

MMNDC2016STRING = " Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & Server.MapPath("data/dbase.mdb")

cn.Open MMNDC2016STRING

sSQL = "INSERT INTO ElectionResults SELECT * FROM " sSQL = sSQL & " Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & Server.MapPath("data/Dataupload.xls").[Sheet1$]

cn.Execute sSQL, recs

MsgBox recs %>

and i get this error

Microsoft JET Database Engine error '80040e09'

Cannot update. Database or object is read-only.

/election/asp_upload.asp, line 33

I have given read/write permission to the database but still getting the same error

Can anyone help me out...

Thank you

0
edit delete
are you sure?
asked Wisdom Deku

1 answer

Thank you for sharing with us .


www.researchmyassignment.com

0
edit delete
are you sure?
answered EVA WILSON

Post an answer but please login first

Post Answer
  1. Please login to post answer

Similar Questions

Tagsfor this question

Forumall questions