Visual Studio VB.NET Global ADODB.CONN -
i building application requires me query as400 database 100 times per single use.
i have functions each of queries right written in following structure.
option explicit on shared function query1() dim conn new adodb.connection dim recordset1 new adodb.recordset conn.open("databasename") recordset1.open("select * table",conn) return somevalue end function
my application runs pretty slow, around 30-40 seconds. i've done performance profiling using tools built visual studio 2013 , noticed repeatedly opening connections database taking significant portion of time.
my question is, can set global connection variable @ top level of routine have open connection once, , close once routine finished queries? think speed application?
something following:
option explicit on global conn adodb.connection conn.open(dsn = "database") shared function query1(byval conn) dim recordset1 new adodb.recordset recordset1.open("select * table",conn) return somevalue end function
thanks in advance !
Comments
Post a Comment