I have an ASP page that is using ADO to connect to an Access 2000 database. In the database itself, I have created a query that goes like this:
I used the Replace functions because I need the query to return values with the spaces and dashes removed, for reasons too complex to explain here. When I run this query from within Access itself, it runs perfectly and generates the desired results.
Now, my ASP page is calling the query in the usual way:
But I get the following error, which refers to the line number with the Open() statement:
So... I've connected to Access queries in ASP before, even ones with functions in them. How come it doesn't work this time? What can I do differently, yet still get the recordset in the format I want?
--Ryan
Code:
SELECT tblEquipmentInfo.EquipmentID, tblEquipmentInfo.Account, tblEquipmentInfo.Detail_Number, Replace(Replace([tblEquipmentInfo]![Stock_Number],"-","")," ","") AS Stock_Number, tblEquipmentInfo.Prime, tblEquipmentInfo.Authorized
FROM tblEquipmentInfo;
Now, my ASP page is calling the query in the usual way:
Code:
Set rsTest = Server.CreateObject("ADODB.Recordset")
rsTest.ActiveConnection = MM_equipment2_STRING
rsTest.Source = "SELECT * FROM qrySbssCompare"
rsTest.CursorType = 0
rsTest.CursorLocation = 2
rsTest.LockType = 1
rsTest.Open()
Code:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Undefined function 'Replace' in expression.
--Ryan