March 16, 2005 at 4:10 am
Like many people we also converted an Access database into an SQL database and an Access client.
When we moved to SQL we noticed that the performance of the frontend was decreased.
With a lot of views on the SQL database we managed to get the same performance, but I still didn't solved the actual problem.
The actual problem is why is retrieving data through ODBC slower that retrieving data from a file server using the same client.
When I just get a table in three different cases
1 from my hard disk with an access database,
2 from a file server with an access database and
3 with ODBC from from the SQL server
the last one is the slowest.
Can someone tell me why this is so, and how I can solve the performance I've lost.
thanx
Marcel
March 17, 2005 at 12:03 am
Take a look at this lively thread
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=165207
--------------------
Colt 45 - the original point and click interface
March 17, 2005 at 6:46 am
If your Access query contains many joins or multiple tables, it's slow using ODBC conections. Either you have to use those queries in the SQL Server view or you have to create a stored procedure and have the required data inserted to a table which you can join in Access. Also if all your tables are in SQL Server, then don't do any inserts, updates or deletes in Access. Do it using a sp in SQL Server. You can call the sp from Access.
March 17, 2005 at 8:52 am
When you use SQL server, instead off using ODBC connection you should use OLEDB connection.
Use ODBC only with WEB based application.
See more doc in MSDN.microsoft.com website.
Ramazan KOYUNCU
March 18, 2005 at 10:15 am
Many of the performance problems that arise after migrating Access to SQL Server are a result of the application not performing as a proper client/server system. Instead data is dragged over the network from the server and processed/filtered on the client.
Have a look at a page on our web site (http://www.aldex.co.uk/sqlupsizing.htmm) which discusses some of these issues.
Regards
David Saville
Aldex Software Ltd.
March 18, 2005 at 2:54 pm
I've found that the use of Access functions will dramatically decrease performance of upsized apps. If you use things like IIF (a favorite, apparently) in your queries, all the data is returned to Access and evaluated locally. To fix the issue, rewrite the query to use a stored procedure and, if necessary, convert some of the Access functions to User-defined functions in sql.
I took an access app that was running 40 sec queries. After upsizing some of the queries went to > 2 minutes. Rewriting as stored procs and user defined functions got them down to sub-second.
March 19, 2005 at 9:30 am
I highly recommend using stored procedures that are called from Access. A great book on the subject is Microsoft Access Developer's Guide to SQL Server by Sams. Lot's of great code and suggestions. Your ap should start to fly after modification.
Access is a great FE for SQL Server but it has to be coded correctly.
Bill
March 22, 2005 at 5:26 am
We are working with an SQL server with an access frontend. In this we experiences some performance problems with drop down boxes.
To solve this I want to go into extreem and want to load the data of the dropdown boxes into the memory of the local PC in a way that the the application doesn't have to reload the data from any database what so ever.
I'm looking at a record set wich I can define on a global bases, but this record set can't be used as recordsource for a listbox. To clarify my excersice this is the thing I'm trying:
--Defining the variable
Public testrecordset As RecordSet
--Setting the recodset
Public Sub testre()
Set testrecordset = DBEngine.Workspaces(0).Databases(0).OpenRecordset _
("SELECT * " + _
"FROM [Q_lookup_Financial instrument]" + ";" _
, dbReadOnly)
End Sub
The idee behind this is that the recordset is now in the memory of the local PC, and the data in this recordset should be fast. It also could be that the data is not in the memory, but in a temp file of the access database.
Anyway my question: Did anyone try to do a simular thing, and did he/she had success?
March 22, 2005 at 6:35 am
Do the values you need from the SQL table change very often? If not, I'd spin through them creating a value list that I assign to the combobox instead of maintaining a connection or a global variable.
Bill
March 22, 2005 at 7:01 am
De values doesn't change a lot, but every day there are new records. The problem is how fast a form opens. If it's possible, I declare a global variable for useing as a dropdowlist. Now I call the dropdown list from memory. May be this is faster. Does anybody know how to do?
When I start the application, I get the up to date dropdownlist
thank you
Marcel
March 22, 2005 at 8:28 am
You ought to be using ADO instead of DAO. This example has not been tested. In the Code window of your form, put some code like this at the bottom:
Private Function getValuesForComboBox() As String
Dim rst as ADODB.Recordset
Set rst = New ADODB.Recordset
Dim qry As String
Dim List As String
qry = "Select [MyField] From [MyTable]"
rst.Open qry, CurrentProject.Connection, adOpenStatic, adLockReadOnly
With rst
List = .Fields("MyField")
Do Until .EOF
.MoveNext
List = List & ";" & .Fields("MyField")
Loop
End With
rst.Close
Set rst = Nothing
getValuesForComboBox = List
End Function
In Properties set your combobox properties like this:
Row Source Type "Value List"
Row Source ""
In the Open Event of the form, put in some code like this:
Me.MyComboBox.RowSource = getValuesForComboBox()
Anytime you want to refresh the list just make the same call.
Hope this helps.
Bill
March 22, 2005 at 8:29 am
Marcel,
Are you using pass through queries to get your data? Pass through queries are normally what is used to call stored procedures. You can insert SQL in them as well. Creating one looks something like this:
Public Function CreateStoredProcedure(strProcName As String, strSQLString)
' Procedure builds a query definition to call a stored procedure
Dim DB As Database
Dim QD As QueryDef
' Open a database from which QueryDef objects can be
' created.
Set DB = DBEngine.Workspaces(0).Databases(0)
On Error Resume Next
DB.QueryDefs.Delete strProcName
' Create a QueryDef object to retrieve
' data from a Microsoft SQL Server database.
Set QD = DB.CreateQueryDef(strProcName)
QD.Connect = Forms!frmhiddenparameters!txtConnect ' Connection String to SQL Database
QD.SQL = strSQLString
QD.ODBCTimeout = 0
QD.Close
'DB.Close
End Function
so I can say:
createstoredProcedure ("sptSelectCust" , "select * from cust order by lname")
and then open the query sptSelectCust to get the results.
These are much faster than access qdfs using linked tables.
March 23, 2005 at 2:00 am
Marcel,
Using local copies of static or semi-static tables can be a help if you have a lot of drop down lists on a form. However make sure that you do not mix the use of local tables and tables on the SQL Server back end in any queries. Ie make sure that you use the original master table on SQL Server rather than the local Access table in any SQL queries.
If you do not do this then the query will be resolved on the client machine and large volumes of unecessary data may be dragged over the network.
BTW the link I provided for our Access to SQL upsizing page earlier in this thread had a typo in it - it should have read http://www.aldex.co.uk/sqlupsizing.html
Regards
David Saville
Aldex Software Ltd.
March 23, 2005 at 6:56 am
We never had any performance problems with drop down lists with ODBC connections. We use the DSN-less connection to SQL Server.
Viewing 14 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic. Login to reply