dcsimg
Results 1 to 10 of 10

Thread: Problem with aplication using MS Access Database after distribution

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Location
    Croatia
    Posts
    23

    Problem with aplication using MS Access Database after distribution

    Hi, I have strange problem with my application (VB.NET 2005 an 2008) that uses MS Access database.

    It all works fine on my system and after other users download it, it works fine for some and for some not. Operating system XP SP2.

    Application writes and reads database.
    I don't use special database controls for database access.

    This is example how it's done.

    Dim dbConnection As New Data.OleDb.OleDbConnection(dbConnectionString)

    Dim command As New Data.OleDb.OleDbCommand(sqlCommand, dbConnection)
    Try
    dbConnection.Open()
    command.ExecuteNonQuery()
    dbConnection.Close()
    Return True
    Catch
    Return False
    Finally
    dbConnection.Close()
    End Try


    I've also created Installation for application.

    Is it possible that is required to include some kind of DLL's in installation that allows application to connect to database?

    Maybe only users that have installed MS Office with Access can read/write to database from my application because after installing MS Access there's also some kind of database access DLL installed for accessing databases? Is it possible?

    Can someone help with this?

  2. #2
    Fanatic Member
    Join Date
    Jul 2006
    Location
    Anchorage, Alaska
    Posts
    545

    Re: Problem with aplication using MS Access Database after distribution

    To help you, we need to know what the exact error you are receiving is.

    What is the error message?
    When does it happen?
    On which computers?

    Any information you can collect about the error, when it happens, and on which computers will greatly increase your chance of getting a reply.
    Please RATE posts, click the RATE button to the left under the Users Name.

    Once your thread has been answered, Please use the Thread Tools and select RESOLVED so everyone knows your question has been answered.


    "As I look past the light, I see the world I wished tonight, never the less, sleep has come, and death shall soon follow..." 1998 Jeremy J Swartwood

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,411

    Re: Problem with aplication using MS Access Database after distribution

    Quote Originally Posted by kiko View Post
    Is it possible that is required to include some kind of DLL's in installation that allows application to connect to database?
    Possibly, but it depends on what the error is... there are several other potential issues (so far we don't even know which line the error is occurring on).
    Maybe only users that have installed MS Office with Access can read/write to database from my application because after installing MS Access there's also some kind of database access DLL installed for accessing databases? Is it possible?
    Your users will not need Office (and certainly not Access) for the kind of code you have shown, but they might need a free Provider (which is included with Office, but is also available separately). Which one depends on the value of dbConnectionString

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Location
    Croatia
    Posts
    23

    Re: Problem with aplication using MS Access Database after distribution

    I'm trying to get this error on my computer but cannot provoke application to show me any kind of error.

    I've installed fresh copy of Windows XP Pro SP2, didn't install any drivers and no additional software, just .NET Framework 2.0 and my application, and all works fine, it seems all is there what is required for application to work.

    Another thing I can do is to try installing Windows XP Pro - fist edition without service pack or maybe Windows XP Home, maybe in these systems errors occur.

    The problem is that after error ocurrs in my app there's no error description shown, just my error text that I've typed in Try - Catch section for error handling.
    Also I didn't mentioned users to provide me with detailed system information they are using...

    If you're interested in trying this application I can give you download link, maybe on your system will also be some kind of problems...
    Software is for sports betting...

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,411

    Re: Problem with aplication using MS Access Database after distribution

    Testing on your computer (or any others) is not the way to do it, because you could easily get a different error rather than the actual one the users are.
    The problem is that after error ocurrs in my app there's no error description shown, just my error text that I've typed in Try - Catch section for error handling.
    That is a very significant mistake... VB wants to tell you exactly what the problem is, but you have decided to stop it from doing that.

    While it is good to show a 'nice' message to the users, you should also include the real error message so that they can tell you, and you can then fix the issues.

    Anything else is purely guessing at what the error might be, so is just a waste of time.
    Also I didn't mentioned users to provide me with detailed system information they are using...
    That is very rarely important, but might be useful in some cases. The thing that is most likely to be important is the version of Windows they are using - and it might be important in this case.

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Location
    Croatia
    Posts
    23

    Re: Problem with aplication using MS Access Database after distribution

    I guess I'll just have to rewrite the code to display error with description...

    But now there's one more problem that I found...
    When installing Windows user usually define Regional settings that can also be set in control panel under in Regional an Language options that affect applications... It's about Date/Time format, it depends on your region you're in Date/Time format differs from one system to another..So if I write my application on system where system short date format is d.m.yyyy, on systems where system date format is set to M/D/yyyy application will pop up with errors when writing to database field with data format set to "Date".

    How to deal with this kind of situations, do I need to write code to check users system date/time settings before writing to database...this could be double work.

    The same thing is when working with math, if users system "Numbers - Decimal symbol" i set to comma (,) and "Digital grouping symbol" i set to period (.), and the system I'm working on has inverted situation then application will not do the math as it should do.. For example on one system 1,22 * 1,33 = 1,62 and on another will calculate as 122 * 133 = 16226

  7. #7
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,411

    Re: Problem with aplication using MS Access Database after distribution

    Regional Settings shouldn't give your program any problems... the reason that they do is because you aren't using safe methods.

    In terms of putting values into SQL statements, don't do it - use Parameters instead and all of the problems you mentioned (and several more) will simply disappear.

    For an explanation of why you should be using parameters (and links to code examples), see the article Why should I use Parameters instead of putting values into my SQL string? from our Database Development FAQs/Tutorials (at the top of this forum).

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Location
    Croatia
    Posts
    23

    Re: Problem with aplication using MS Access Database after distribution

    I'm aware that I didn't use the best and safest methods in my code and didn't think this will cause so much problems...

    Thanks for detailed info!

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Location
    Croatia
    Posts
    23

    Re: Problem with aplication using MS Access Database after distribution

    One more question I forgot to ask...It's about database security, I know that Access database can be protected with password but that's maybe not enough, there are applications that can in few seconds hack database password. Is there any other way to protect data so that users can only see it using application distributed with that database?

  10. #10
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,411

    Re: Problem with aplication using MS Access Database after distribution

    There is no way to protect a database totally, all you can do is make it a bit harder - and it takes a lot of effort for a relatively small gain.

    If the file format is Access2000 or later, the password is actually fairly good (it will take quite a long time to get the password). There are other methods too, but I've never used them because I've never distributed an Access database publicly.


    A better thing to do is protect the data by encrypting it when you put it in the database, and decrypt it when you get it out again.

    How effective that will be depends on the method you use, but it should easily be better than the built-in protection methods.

    It will however mean re-writing all of your database interaction code to use the encrypt/decrypt, and that could take some time.


    Whichever method(s) you think about using, make sure it is worth it - as more often than not the data is not really important enough to justify lots of extra hours of development (especially if the user can see all the data via your program).

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width