Self teaching, cannot lock database file

Discussion in 'ASP .Net' started by Michael Powell, Mar 29, 2005.

  1. Hi,
    I have been teaching myself C# and ASP, i wrote a sign-in and register
    program to teach myself the use of SQL and databases using C# as the
    development language.
    Yesterday my little program worked a treat (except for the lack of error
    handling), i came back to it today to complete it, and when i run the
    program i get the following error:

    Exception Details: System.Data.OleDb.OleDbException: Could not lock file.

    Source Error:

    Line 74:
    this.oleDbCommand1.Parameters.Add("pass",OleDbType.Char).Value=this.TextBox2.Text;
    Line 75: if(this.oleDbConnection1.State!=ConnectionState.Open)
    Line 76: this.oleDbConnection1.Open();
    Line 77: OleDbDataReader rdr=this.oleDbCommand1.ExecuteReader();
    Line 78: if(rdr.HasRows)


    does anyone know why this error occurs, or how to fix it.
    (I don't actualy mind it not working, i just NEED to understand it!)
    Any input would be most apprecciated

    Mike Powell
     
    Michael Powell, Mar 29, 2005
    #1
    1. Advertising

  2. What database are you using.
     
    =?Utf-8?B?U2NvdHQgU2ltb25z?=, Mar 29, 2005
    #2
    1. Advertising

  3. Michael Powell

    Hans Kesting Guest

    Michael Powell wrote:
    > Hi,
    > I have been teaching myself C# and ASP, i wrote a sign-in and register
    > program to teach myself the use of SQL and databases using C# as the
    > development language.
    > Yesterday my little program worked a treat (except for the lack of error
    > handling), i came back to it today to complete it, and when i run the
    > program i get the following error:
    >
    > Exception Details: System.Data.OleDb.OleDbException: Could not lock file.
    >
    > Source Error:
    >
    > Line 74:
    > this.oleDbCommand1.Parameters.Add("pass",OleDbType.Char).Value=this.TextBox2.Text;
    > Line 75: if(this.oleDbConnection1.State!=ConnectionState.Open)
    > Line 76: this.oleDbConnection1.Open();
    > Line 77: OleDbDataReader rdr=this.oleDbCommand1.ExecuteReader();
    > Line 78: if(rdr.HasRows)
    >
    >
    > does anyone know why this error occurs, or how to fix it.
    > (I don't actualy mind it not working, i just NEED to understand it!)
    > Any input would be most apprecciated
    >
    > Mike Powell
    >
    >


    I think this happens in Access, when you have a designer open.


    --
    Hans Kesting
     
    Hans Kesting, Mar 29, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ralf W. Grosse-Kunstleve
    Replies:
    16
    Views:
    628
    Lonnie Princehouse
    Jul 11, 2005
  2. Ralf W. Grosse-Kunstleve
    Replies:
    18
    Views:
    627
    Bengt Richter
    Jul 11, 2005
  3. Ralf W. Grosse-Kunstleve
    Replies:
    2
    Views:
    433
    Dan Sommers
    Jul 12, 2005
  4. falcon
    Replies:
    0
    Views:
    406
    falcon
    Jul 31, 2005
  5. Stefan Ram

    Teaching Java, teaching what?

    Stefan Ram, Dec 8, 2013, in forum: Java
    Replies:
    57
    Views:
    666
    Ali Sh
    Dec 18, 2013
Loading...

Share This Page