help in publishing a .net application that uses microsoft access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yojimbo4
    New Member
    • Nov 2007
    • 4

    help in publishing a .net application that uses microsoft access

    Hi, i am using vb.net 2005, and i am using microsoft access as my database

    I have published the application using the built in publisher of vb.net and come up with the setup.exe,

    after publishing i tested the setup.exe and tried installing it on my computer,
    all went well, until i tried to run the installed application, there is an error that says "cannot find file...../db1.mdb"

    it seems that when i publish the application, it does not include the database i am using "db1.mdb".

    is there some way to include my database in publishing the application?

    thank you for the replies...
  • balabaster
    Recognized Expert Contributor
    • Mar 2007
    • 798

    #2
    Originally posted by yojimbo4
    Hi, i am using vb.net 2005, and i am using microsoft access as my database

    I have published the application using the built in publisher of vb.net and come up with the setup.exe,

    after publishing i tested the setup.exe and tried installing it on my computer,
    all went well, until i tried to run the installed application, there is an error that says "cannot find file...../db1.mdb"

    it seems that when i publish the application, it does not include the database i am using "db1.mdb".

    is there some way to include my database in publishing the application?

    thank you for the replies...
    Did you actually include your database in your project or just reference it from the config file? If you add the database the database (right click your project in the project explorer and select "Add existing item..." and go find your database.

    Comment

    • yojimbo4
      New Member
      • Nov 2007
      • 4

      #3
      i tried doing it, and after i published it again, i saw the deploy file of my mdb
      named db1.mdb.deploy, but after trying to install it again, the same problem occurs (cant find file ...../db1.mdb)

      is it because i am using unbound connection,
      i connect to the database by using this line of codes:

      Dim con As String = "Provider = Microsoft.Jet.O LEDB.4.0;" & "Data Source = db1.mdb"
      Dim sql As String = "select * from users"
      Dim da As New OleDb.OleDbData Adapter(sql, con)
      da.Fill(dt)


      thanks for the help, i really appreciate it...

      Comment

      • balabaster
        Recognized Expert Contributor
        • Mar 2007
        • 798

        #4
        Originally posted by yojimbo4
        i tried doing it, and after i published it again, i saw the deploy file of my mdb
        named db1.mdb.deploy, but after trying to install it again, the same problem occurs (cant find file ...../db1.mdb)

        is it because i am using unbound connection,
        i connect to the database by using this line of codes:

        Dim con As String = "Provider = Microsoft.Jet.O LEDB.4.0;" & "Data Source = db1.mdb"
        Dim sql As String = "select * from users"
        Dim da As New OleDb.OleDbData Adapter(sql, con)
        da.Fill(dt)

        thanks for the help, i really appreciate it...
        Er - is your database in the same path as your ASP code? If so, that presents a bit of a security risk. You don't want some erroneous error spewing out the name of the database therefore granting some user to be able to just plug that on the end of the web address and downloading it for their own nefarious use.

        Okay...in your solution explorer single click your database object (the one with the yellow cylinder next to it) and in the properties window down below you may notice a "Copy to Output Directory" property that is likely marked as "Do not copy" change it to either option "Copy if newer" or "Always copy". That should transfer your database into your output folder when you publish.

        Comment

        Working...