Well, the first problem is that you are using conn1 to connect to the Sybase DBMS, and including tblClassEmpl1 in the query string. The server is trying to build the recordset on the server, not on your local machine, so unless the Sybase server has a connection to the Access table, this is not going to work.
It is trying to compile the recordset on the server, then send the results back to your Access request.
What you need to do is make a query to the entire Sybase table with no joins or parameters, then once the data is pulled as a recordset, run a local query using the Access linked table.
What I would suggest is to grab the data from the local Access table that you are using as parameters in the Sybase query, and then just pass the parameters to a view you build on the server. If it is an AffiliateID, for example, pass the AffiliateID to the Sybase view, and process the query on the server, then transfer just those results to a temporary table and base your report on that table. You will need to delete everything in that table before you run each report.
If this is ust an OLAP front end, what I do is to download all of my SQL Server tables as the application opens passing username and password, and then process all the queries etc locally, so there is no additional network traffic after the first pull. If you are doing any OLTP, you don't really want to do this. It depends on the number of concurrent users.
mmcdonal
|