Question : Multiple MS Access Database connection problem...

Hi

I have a multi user MS Access database environment where a given user could connect to one of many MS Access databases using ASP jscript pages.

The problem I am having is that if a given user A connects to an asp web page using database1.mdb and user B connects to an asp web page using database2.mdb at "the same time" the connection string of user A seems to inherit the connection string of user B when page is executed even though I tell connection to point to database1.mdb! How is this corruption happening?

This results in the error "The Microsoft Jet database engine cannot find the input table or query..."

I believe I may have something missing in the connection string, or
maybe I have to set some value on the server II6, or
is it something completely different?

Below is an example of connection that I would make to each database.

Any help would be greatly appreciated.

//Where mapping is connection string to one of 10 MS Access databases
Application("dbConnectString")="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + mapping + ";"

dbConnectionData = Server.CreateObject("ADODB.Connection")

rset = Server.CreateObject("ADODB.Recordset")
rset.Open ( sql,dbConnectionData,adCursorType,adLockType)

Answer : Multiple MS Access Database connection problem...

The problem is that you're storing the connection string in an application variable. Application variables are shared by all the application users, so when you set the connection string for a user really you're setting it for all users.

If each user must have its own connection string, then store it in session variables instead of application variables.

Hope that helps.
Random Solutions  
 
programming4us programming4us