Are you using Option Explicit in your code?
Unless you Dim'd Conn at a higher level than you've shown, Conn will disappear when you exit your function, it's scope is local to the function.
You can return Conn as the result of your function, or you can make sure Conn has global scope by Dim-ing it at the very top of your page not in a function or sub.
If you want to return Conn as the result of your function, do something like this:
Function OpenDB()
Set Conn= Server.CreateObject("ADODB.Connection")
Connstr= "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
Connstr=Connstr & "DATA SOURCE=" & server.mappath("/db.mdb") & ";"
Conn.Open(connstr)
Set OpenDB = Conn
END Function
And call as
Set ThisConn = OpenDB()
======
Doug G
======