Dabas,
Is there other ways to improve it? Sometimes it takes about 10 minutes for the first time connection....
Main Topics
Browse All Topicsvb6, M.Access, Data Report Designer
Why its always take lot of times when i want to preview/print out the report? This situation only occurs when it is the FIRST time i preview/print the report, it will works well on the following preview/printing . Is it somewhere wrong with my connection?
Public Sub DBConnect()
Set db = New ADODB.Connection
db.ConnectionString = "Provider=Microsoft.Jet.ol
"Persist Security Info=False; Data Source=" & App.Path & "\SO.mdb; Mode=ReadWrite"
db.Open
End Sub
Private Sub cmdPreviewPrint_Click()
Dim sqltext As String
With rptSalesOrder
.LeftMargin = 0
.RightMargin = 0
.TopMargin = 0
.BottomMargin = 0
.Orientation = rptOrientLandscape
.ReportWidth = 15550
End With
rptSalesOrder.Show
If rs.rsCommand3_Grouping.Sta
rs.rsCommand3_Grouping.Clo
End If
rptSalesOrder.Sections.Ite
sqltext = "SHAPE { SELECT *"
sqltext = sqltext + " FROM Customer,Transaction, tlbItem "
sqltext = sqltext + " Where Transaction.Mno = tlbItem.Mno"
sqltext = sqltext + " and Transaction.CustName = Customer.CustName"
sqltext = sqltext + " and SONumber = " & cboSONO.text & " } AS COMMAND3 COMPUTE COMMAND3 BY 'Transaction.CustName','Sh
rs.rsCommand3_Grouping.Ope
rptSalesOrder.Refresh
rs.rsCommand3_Grouping.Clo
End Sub
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
slBoon,
10 minutes!!!!
That is not admissable.
If I had this problem, I would try to establish WHERE in the code the slowness is happen.
The three candidate culprits are:
db.Open
rs.rsCommand3_Grouping.Ope
rptSalesOrder.Refresh
I suggest you set a breakpoint (highlight line and press F9) on each one of the lines in the IDE. Run the program. When it stops at the breakpoint, press F8 to continue and see which one is causing the delay.
Depending on the culprit line, we will together find out how to continue
Dabas
slBoon,
I do not use the report designer that often, preferring Crystal reports.
Still, everything seems to indicate that the moment you go get to that With rptSalesOrder instructions, the reports tries to access all the relevant data.
Can you remove the datasource from the design of the report, and hand it over at runtime after you have already called the query from code?
Dabas
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- Accept Dabas comment as answer
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
MYLim
EE Cleanup Volunteer
Business Accounts
Answer for Membership
by: DabasPosted on 2003-09-16 at 14:39:04ID: 9373802
Hi slBoon:
The way ADODB works is that it takes its time establishing a connection to your data source.
Once it has done so, it "remembers" it for the future. (Even if you close the connection)
For that reason you will have a longer wait the first time you connect to your source
Dabas