exampass2004 Posted November 14, 2005 Share Posted November 14, 2005 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 More sharing options...
Jerome Posted November 14, 2005 Share Posted November 14, 2005 Hello there!What is the value of HARDWARE?Try this : rstExcel.Source = " SELECT * FROM STOCK_RR WHERE STOCK_TYPE = '" & HARDWARE & "' " Link to comment Share on other sites More sharing options...
exampass2004 Posted November 15, 2005 Author Share Posted November 15, 2005 Good day, Jerome. I already try using your method: rstExcel.Source = " SELECT * FROM STOCK_RR WHERE STOCK_TYPE = '" & HARDWARE & "' " However, the problem still happened. Can you have any alternative ways to help me solve this problem. Thanks you. Link to comment Share on other sites More sharing options...
Jerome Posted November 16, 2005 Share Posted November 16, 2005 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now