Results 1 to 8 of 8

Thread: Access Database and asp.net

  1. #1
    keroed1 Guest

    Default Access Database and asp.net

    i created a microsft access database but i added a password to it and i want to be able to access a table in my access database using asp.net normally i would do this

    Code:
    New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=" & "c:\db.mdf")
    for example but i dont know how i would do this with a password protected database, would i jus use the same connection string or would ihave to do it differently and if so how???
    Last edited by Arch_Angel; May 29, 2006 at 07:20 PM. Reason: added CODE tags

  2. #2
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Use VS Server Explorer to conect to the mdf file. Its simple. Just fill in the password in the wizard. Finally drag the connetion from the Server Explorer to a test project. Look at the code that is created, copy it to the ASP.net proj
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  3. #3
    keroed1 Guest

    Default

    i trying to do it using server explorer but it not working, i woulda rather do it in code since i cant figure out how to do it using the serevr explorer

  4. #4
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    C#
    Code:
    oleDbConnection1.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=J:\DBs\Office10\1033\FPNWIND[edit].MDB;Mode=Share Deny None;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False";
    VB
    Code:
            Me.OleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=J:\DBs\Off" & _
            "ice10\1033\FPNWIND[edit].MDB;Mode=Share Deny None;Extended Properties="""";Jet OLE" & _
            "DB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";" & _
            "Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Parti" & _
            "al Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Passwo" & _
            "rd="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Je" & _
            "t OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Rep" & _
            "air=False;Jet OLEDB:SFP=False"
    Last edited by Arch_Angel; May 29, 2006 at 10:17 PM. Reason: merged multiple posts
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  5. #5
    keroed1 Guest

    Default

    sorry about that going to read as i sent this i saw ur new post, i reading it now
    Last edited by keroed1; May 29, 2006 at 10:23 PM.

  6. #6
    keroed1 Guest

    Default

    Look on the code below thats what i used

    OdbcConnection1 = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA Source=C:\login.mdb; User ID=admin; Password=yne123; ")

    and i got this error
    :::::::::::::::::::::::::::::::::
    Cannot start your application. The workgroup information file is missing or opened exclusively by another user.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.OleDb.OleDbException: Cannot start your application. The workgroup information file is missing or opened exclusively by another user.

    Source Error:

    Line 51: OdbcConnection1 = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA Source=C:\Inetpub\wwwroot\CallAccounting\members\a dmin\images\banners\CallAccounting_Banner.mdb; User ID=admin; Password=ivspivr; ")
    Line 52:
    Line 53: OdbcConnection1.Open()

    is it a case where i need to know the workgroup and if so how?

  7. #7
    Join Date
    Dec 2002
    Posts
    500
    Rep Power
    0

    Default

    no, the workgroup information file is a database file used by access to store the usersnames and passwords used by the (JET) database. its just an ordinary file, and its saying it cant find it. this may happen if you have not enabled passwords in access (activating the feature creates the file) on the machine or if you have moved the file once it has been created. i think this happened to me some time ago. i didnt fix it, i just switched to MSDE its free and performs better than access (and uses SqlClient namespace)

    Get rid of Access (i know you can't, just rubbin' it in)
    Cultured in Aggression and Koding like a Warrior!!
    “Common sense is instinct. Enough of it is genius.” - George Bernard Shaw.
    "The significant problems we face cannot be solved by the same level of thinking that created them." - Albert Einstein

  8. #8
    keroed1 Guest

    Default

    Quote Originally Posted by icymint3
    no, the workgroup information file is a database file used by access to store the usersnames and passwords used by the (JET) database. its just an ordinary file, and its saying it cant find it. this may happen if you have not enabled passwords in access (activating the feature creates the file) on the machine or if you have moved the file once it has been created. i think this happened to me some time ago. i didnt fix it, i just switched to MSDE its free and performs better than access (and uses SqlClient namespace)

    Get rid of Access (i know you can't, just rubbin' it in)
    lol lol
    i got to solve the problem now icemint, thanks though

Posting Permissions

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