Ok I am not sure that I understand what you are tyring to do but here goes.
First and foremost, ALWAYS explicitly close your database connections, otherwise you can wind up with memory leaks and such.
Secondly, yes you can include a file that contains methods to connect to your database, for example, say that you had a method in your include file called ConnectToDatabase on your actual page you would do something like this:
'Some code
ConnectToDatabase()
'some more code
In so far as returning stuff you would need to write some sort of function, for example:
In your include file:
Function doFoo(value1, value2)
Dim sFooValue
sFooValue = value1 + value2
doFoo = sFooValue
End Function
Then on your host page:
Dim sFoo
sFoo = doFoo(1, 2)
hth.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
================================================== =========