ASP.NET and Access

Results 1 to 3 of 3

Thread: ASP.NET and Access

  1. #1
    Wes Weeks Guest

    Default ASP.NET and Access

    I am trying to update a page that is currently working in regular ASP to ASP.NET and I keep getting the following error:<BR><BR>[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file &#039x:members.mdb&#039. It is already opened exclusively by another user, or you need permission to view its data<BR><BR>The database is unencrypted and doesn&#039t require a username or password. I have lowered both the share permissions and the NTFS permissions to Full Control for both this folder and it&#039s contents and I still get the error. I do not get this error if I execute the same script against SQL server. I have even created a front end to the database on the webserver and tried accessing the back end that way and I still get the error. Is this a beta version bug or is there something else I could be missing?

  2. #2
    Doug Seven Guest

    Default RE: ASP.NET and Access

    Typically this error mean that the mcb file is locked because another user accessed it. Occassionally Access will (because of caching) lock for a short period of time. This is one reason Access is not recommended for web apps.<BR><BR>Can you post your code so we can see if there is something wrong?<BR><BR>Thanks,<BR>Doug Seven<BR>CodeJunkies.Net /

  3. #3
    Wes Weeks Guest

    Default RE: ASP.NET and Access

    Here is the working ASP code:<BR><BR>&#060;%<BR>Dim adoConnection &#039As ADODB.Connection<BR>Dim adoRecordset &#039As ADODB.Recordset<BR>Dim strQuery &#039As String<BR><BR>strQuery = "Select * From tblTest"<BR><BR>Set adoConnection = Server.CreateObject("ADODB.Connection")<BR>adoConn ection.Open "Test" &#039DSN<BR><BR>Set adoRecordset = Server.CreateObject ("ADODB.Recordset")<BR>adoRecordset.Open strQuery, adoConnection, adOpenStatic, adLockReadOnly<BR><BR>Do While NOT adoRecordset.EOF<BR><BR> Response.Write(adoRecordset("t_FirstName") & " " & adoRecordset("t_LastName") _<BR> & " " & adoRecordset("t_Age") & "<BR>")<BR> adoRecordset.MoveNext<BR><BR>Loop<BR><BR>%&#062;<B R><BR>Here is the non-working ASP.NET code:<BR>&#060;%<BR>Dim adoConnection &#039As ADODB.Connection<BR>Dim adoRecordset &#039As ADODB.Recordset<BR>Dim strQuery As String<BR><BR>strQuery = "Select * From tblTest"<BR><BR>adoConnection = Server.CreateObject("ADODB.Connection")<BR>adoConn ection.Open ("NewSertoma")<BR><BR>adoRecordset = Server.CreateObject ("ADODB.Recordset")<BR>adoRecordset.Open (strQuery, adoConnection, adOpenStatic, adLockReadOnly)<BR><BR>Do While NOT adoRecordset.EOF<BR><BR> Response.Write(adoRecordset("t_FirstName").Value & " " & adoRecordset("t_LastName").Value _<BR> & " " & adoRecordset("t_Age").Value & "<BR>")<BR> adoRecordset.MoveNext<BR><BR>Loop<BR><BR>%&#062;<B R><BR>As you can see there are minimal changes between the working ASP and the non-working ASP.NET. I have tried both DSN and DSN-less connections. This is a test application run on a test database accessed only by myself, so others aren&#039t locking it. It is however located on a share on another computer. (Necessary for testing as this will be a deployment possibility) I have been able to get the code to work fine with SQL server, but not Access. For my current needs, this must work under Access. As I stated in the previous post, permissions are set at full control for everyone for both sharing and NTFS permissions for this folder and this database.<BR><BR>The scripts work fine with a local Access database.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts