Visual Basic Development Bookmark and Share   
 Home > Visual Basic Interop and Upgrade > Sending an Open Connection to the Interop Control ??
 

Sending an Open Connection to the Interop Control ??

In my Introp Control I need to get data from My SQL Database.
It is a too big wait (much more than in the VB6 prg!).
Could I send to the iCtrl an already open SQL.Connection?
(I tried, but failed ?!)
Thanks

ADH
adhsys  Sunday, November 08, 2009 6:00 PM
You might want to limit your query to a certain number of rows returned. I wouldn't expect the connection to be an issue. Once a connection has been created connection pooling should eliminate the overhead in subsequent queries.
Paul ~~~~ Microsoft MVP (Visual Basic)
Paul P Clement IV  Monday, November 09, 2009 2:21 PM
Are you using the .NET provider for MySQL or the OLEDB or ODBC driver?Ifyou're not usingthe .NET provider you may want to consider switching to that to see if performance improves.
Paul ~~~~ Microsoft MVP (Visual Basic)
Paul P Clement IV  Sunday, November 15, 2009 4:52 PM

Hello ADH,

As my understand, your .NET is marshaled into the VB6 control to executed. So we cannot pass a .NET SQL connection object into the your iCtrl because VB6 codes just do not understand the managed connection object.

By the way, for a performance issue, we'd better firstly find out where is the bottle neck and then find strategies for it. How long you wait for what codes to execute when you are using Interop? Could you please be a little more specific so that the community may give some suggestions.

Have a nice day!

Ji Zhou

MSDN Subscriber Support in Forum

If you have any feedback on our support, please contact msdnmg@microsoft.com


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Ji.Zhou  Monday, November 09, 2009 8:09 AM
Ji, thanks for your reply.
I am waiting several seconds (-+8, Too long for an end-user to wait) starting when the Icontrol Opens the SQL.Connection and reads datausing a sp.
I have modified the interaction, so now I am sending an ADODB.Recordset, converting it, by the iCtrl,to a Datatable and displaying the grid. Now the wait is tolerable (3-4 secs.)
Still would prefare that the Ictl would handle all it's data.

ADH
adhsys  Monday, November 09, 2009 10:27 AM
You might want to limit your query to a certain number of rows returned. I wouldn't expect the connection to be an issue. Once a connection has been created connection pooling should eliminate the overhead in subsequent queries.
Paul ~~~~ Microsoft MVP (Visual Basic)
Paul P Clement IV  Monday, November 09, 2009 2:21 PM
Paul, The fact is that caling the form with the Interop Control from my VB6 prog. which then opens an SQL Connection takes about +4 secs.
When sending a prepared recodrset(from the VB6 prg to the same form+Interopcontrol)and with no need to open the connection, takes 1-2 secs.
The amount of data is meaningless although the store procedures it calss is heavy.
Thanks
ADH
ADH
adhsys  Sunday, November 15, 2009 11:20 AM
Are you using the .NET provider for MySQL or the OLEDB or ODBC driver?Ifyou're not usingthe .NET provider you may want to consider switching to that to see if performance improves.
Paul ~~~~ Microsoft MVP (Visual Basic)
Paul P Clement IV  Sunday, November 15, 2009 4:52 PM

You can use google to search for other answers

Custom Search

More Threads

• Where can I see some demoes?
• VB6 COM ReadOnly Property With ByRef Arguments
• pivotwizard fails with Office 2003
• Debugger Not Allowing Me To Trap Errors.
• using vb .net dll in vb
• Problem with a class library (ActiveX)
• Custom comboBox behavior (VB.NET Interop Control)
• Is it possible to run VB6.0 under Windows Server 2003?
• Export datagridview to Excel Process Instance Remains in Memory
• Consuming VB.Net COM object in VB 6