Link to home
Start Free TrialLog in
Avatar of svenkatapuram
svenkatapuram

asked on

Application Running Very slow


I am using VB6.0 and ADO 2.1 for my application. I developed the application on WindowsNT 4.0. But my users some have Windows 95 and some have Windows 98. I installed the application on both 95 and 98 machines.
When i tested on one 98machine (which does not have VB on it) the performance was very slow event though it is Pentium II with 450Mhz. That is when accessing the data it is very slow. But when i tested on Windows95 which is Pentium with 90Mhz (it has VB on it) it was OK.

Iam using ADO 2.1 for my application. And i am using connection pooling for my application
My connection string is as follows
gConnStr$ = "Provider=MSDASQL;SERVER=" & Server & ";DATABASE=" & dbname & ";UID=" & Userid_db & ";PWD=" & PassWD & ";OLE DBServices=-2;DSN=" & DB_DSN

I am using the ODBC driver. And most of the time i am running Asynchronus queries becuase i am querying large number of records. When i tried with SQLOLEDB with Asynchronus i was not able to use the datacontrol recordset formy spread control.

And i am explictly enabling the connection pooling for my application like below

'here enableing the ODBC connection pooling
rc = SQLSetEnvAttr(0&, _
SQL_ATTR_CONNECTION_POOLING, _
SQL_CP_ONE_PER_DRIVER, _
SQL_IS_INTEGER)
If rc <> 0 Then
MsgBox "SQLSetEnvAttr Error " & rc
End If

And in my mainform unload event i am closing it like this

'here setting off the ODBC connection pooling
rc = SQLSetEnvAttr(0&, _
SQL_ATTR_CONNECTION_POOLING, _
SQL_CP_OFF, _
SQL_IS_INTEGER)
If rc <> 0 Then
MsgBox Err.Description
End If

And I ran the latest Mdac_type.exe and Dcom98.exe on client's machines beforei install my application.
I do not know why it is very slow on Windows95 which does not have VB. I do not know exactly what is the reason.

If you explain me where i am doing wrong, or anyohter suggestion i really appreciate it.

Thanks
 

Avatar of Jon_Raymond
Jon_Raymond

Did you use the setup program to install all referenced libraries?
I agree, the long wait is probably caused by an ambigious reference in the libraries that takes windows a long time to resolve.
Check for double references of you components in the registry.
Best is to create a setup application. Before running that remove "all" references to your components from the registry.
Avatar of svenkatapuram

ASKER

Jon Raymond,

Yes i used setup program to install all referenced libraries.

Phiro,

can you please elaborate your comment. I do not understand what do you mean by removing "all" references from the registry

Thanks both of you  for your help
I forgot to mention that i am using both DAO and ADO but the order of reference in my application is ADO 2.1 is first and then DAO.

Phiro, as you mentioned becuase of both the references causing the problem.
ReCompile the program
ASKER CERTIFIED SOLUTION
Avatar of phiro
phiro

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
phiro,

i removed the DAO reference from my application and recompiled the program and ran the set up again. This time it is little bit faster. But not as fast as in development environment. What i understood from your explanation that some components reference is registered twice in the registry. So remove the duplicate ones from registry and load VB again or my application ( i do not understand here)

And I do not know anything about VBIDE where can i get the information?

Thanks for your help
VB IDE is just the VB interface (developement environment) that you see when you open VB.  i think Phiro is saying that when you step through the code, see which command(s) seem to hang up.  Those are the references causing the problem.

Also, have you installed the latest MDAC from microsoft.com.  This has helped me in similar situations.
Jon Raymond:
You are right, that was what I ment.
Jon Raymond,

Yes i installed the lates MDAC