Jump to content

Query Excel Data Using ADO From ASP Problem!


exampass2004

Recommended Posts

Dear all, Good day to all of you. Can someone help me regrading Query and Update Excel Data Using ADO From ASP. Last week, I already solve the problem regarding reading excel file using OLEDB problem.However, I have faced some minor problem in Query and Update Excel Data Using ADO From ASP.The code is shown below is compiled succesfully:Set cnnExcel = Server.CreateObject("ADODB.Connection")cnnExcel.Open "DBQ=" & Server.MapPath("STOCK.xls") & ";" & _ "DRIVER={Microsoft Excel Driver (*.xls)};"Set rstExcel = Server.CreateObject("ADODB.Recordset")rstExcel.ActiveConnection = CnnExcelrstExcel.CursorType = 3 'Static cursor.rstExcel.LockType = 2 'Pessimistic Lock.rstExcel.Source = "SELECT * FROM STOCK_RR"rstExcel.OpenBut when I change the rstExcel.Source = "SELECT * FROM STOCK_RR WHERE STOCK_TYPE = 'HARDWARE' ", there was an error happened.The code below got the error after changing the rstExcel.Source: Set cnnExcel = Server.CreateObject("ADODB.Connection")cnnExcel.Open "DBQ=" & Server.MapPath("STOCK.xls") & ";" & _ "DRIVER={Microsoft Excel Driver (*.xls)};"Set rstExcel = Server.CreateObject("ADODB.Recordset")rstExcel.ActiveConnection = CnnExcelrstExcel.CursorType = 3 'Static cursor.rstExcel.LockType = 2 'Pessimistic Lock.rstExcel.Source = "SELECT * FROM STOCK_RR WHERE STOCK_TYPE = 'HARDWARE' "rstExcel.Open 'Error messages result_new/asp,line 210 is this line(rstExcel.Open), can someone please try to have a look into it, thanks you. The error message isMicrosoft OLE DB Provider for ODBC Drivers error '80040e21' ODBC driver does not support the requested properties. /result_new.asp, line 210Hope to see the reply as soon as possible, thanks you.

Link to comment
Share on other sites

exampass2000, I have been looking and asking but it doesn't seem posible to specify more your sql query when working with an excel file...But I hope I'm wrong...Does anybody have any idea?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...