When I set up my connection string in web.config and go from there, it works like a charm. I still don't know the reason why the connection string in the file broke, but the most important thing is that it works now.
Thanks!
EDIT: Spoke too soon... Using the physical path to my database in web.config, it works. However, when I include code to use Server.Mappath because I don't know the physical path on the web server, it gives me the same object reference error.
Snippets:
web.config:
<appSettings>
<add key="Conn" value="Provider=Microsoft.Jet.OLEDB.4.0; Data Source={0}" />
<add key="dbfile" value="data/base.mdb"/>
</appSettings>
Declaration of the connection string in my code file:
Dim conn As String = ConfigurationManager.AppSettings("Conn")
Dim file As String = ConfigurationManager.AppSettings("dbfile")
Dim strConn As String = String.Format(conn, Server.MapPath(file))
Dim cn As New OleDbConnection(strConn) It's the same problem I had in the beginning, I think, since it works on a page not linked to the master page. It throws me an object reference error on the line where strConn is declared. The problem should lie with Server.MapPath I think, but I have no idea what it could be...