Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have multiple recordsets on a pag

Status
Not open for further replies.

struth

Programmer
Aug 26, 2001
114
GB
I have multiple recordsets on a page that use the same connection file to
connect to various tables in an access mbd via the usual include file
procedure:



<!--#include file=&quot;../Connections/connMydb.asp&quot; -->

Set....
recordset1.ActiveConnection = MM_connMydb_STRING

Set......
recordset2.ActiveConnection = MM_connMydb_STRING

etc



I did have to comment out the 'dim MM_connMydb_STRING' in the file
connMydb.asp which has always worked just fine until this week when on one
server I started to get


the '80004005 unspecified error ' or 'file in use error' on the
Activeconnection line.

I know guys it's a permissions problem, my service provider know its a
permissions problem but now after my site being down for a week they are
trying to blame the error on my DMX coding and have brought in a developer
who has recoded the page to set up a new connection string which makes a
single call on the connMydb.asp which then means the page works. They have
said I should recode all my pages that do something similar.


dim connNew
set connNew = server.createobject(&quot;adodb.connection&quot;)
connNew.open MM_connMydb_STRING


Set....
recordset1.ActiveConnection = connNew

Set......
recordset2.ActiveConnection = connNew

etc



Of course I now lose the ability to edit my recordset sql via the
applications panel which is really handy and all I am doing in this case is
papering over the serious cracks in the server permissions. I can see that
this code is probably more efficient and helps the page load faster but I
don't see that it is vital to its functioning. Indeed, I can prove it
because I have my DMX multiple connections pages working fine on all of my
other asp/Access sites.

Perhaps to get over this problem I should set up multiple connection files
to the same mdb eg connMydb1.asp, connMydb2.asp etc. Anyway I would be
grateful for your thoughts.

TIA
Struth


&quot;Away from the actual ... everything is virtual&quot;
 
Don't fall in the poorly excuses like:&quot;You'll have to recode your pages!&quot;
That's crap!

If your connection worked once it's 100% correct.


The second code block you is better to use, and I belive it's more reliable than the first way, but this kind ofthings can be done in multiple ways.

So far I've seen up to 3 TOTALLY different ways of opening a rs.

So don't worry, The problem must be with the host.

-- Webmonkey --
 
Thanks!

Glad you agree...thought maybe I was losing it!!!

&quot;Away from the actual ... everything is virtual&quot;
 
Already do .... OLEDB .... but thanks and nice link to a very clean explanation of dsn-less

my connection file - the include one - is now like this thanks to recent advice:

Dim MM_myConn_STRING
' for local development
MM_myConn_STRING = &quot;Provider=Microsoft.Jet.....&quot;
' for remote server, comment out the above line, uncomment the below lines
' Set MM_myConn_STRING = Server.CreateObject( &quot;ADODB.Connection&quot; )
' MM_myConn_STRING.ConnectionString = &quot;Provider=Microsoft.Jet....&quot;
' MM_myConn_STRING.Open

which seems to work better with multiple recordsets on a page.

Although you may find you need to comment out the
Dim MM_myConn_STRING
line as well

Thanks again


&quot;Away from the actual ... everything is virtual&quot;
 
nice....if u can execute all RecordSets while the connection is open then even better!
All the best!

> need more info?
:: don't click HERE ::
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top