Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Is it possible to create an Access database with Pure C# Code

Is it possible to create an Access database with Pure C# Code

Scheduled Pinned Locked Moved C#
questioncsharpdatabasehelpcareer
9 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Infernojericho
    wrote on last edited by
    #1

    Hi fellas. I am writing a association membership system for my Final Year Project. However I have a few concerns and needs some help. 1. I spoke to my professor, who saids the size of the members in the associate is around several hundreds, maybe a little over a thousand max. I wanted the simpliest database possible. Could Access be able to handle the job? Is it reliable and secure? 2. A friend of mine told me Access only allows 1 database connection at a time. Is this true? Can anyone vouch for this? 3. This is the most important question. The site I am building is a generic one. It will be used in several associations for real. I can safely assume that different associations uses different fields for their databases. Is it possible that I can write an initial setup page, where the user could define the fields involved, then a customized database could be generated? Is it possible? Thanks and looking forward to you guys' replies!!!

    C T 2 Replies Last reply
    0
    • I Infernojericho

      Hi fellas. I am writing a association membership system for my Final Year Project. However I have a few concerns and needs some help. 1. I spoke to my professor, who saids the size of the members in the associate is around several hundreds, maybe a little over a thousand max. I wanted the simpliest database possible. Could Access be able to handle the job? Is it reliable and secure? 2. A friend of mine told me Access only allows 1 database connection at a time. Is this true? Can anyone vouch for this? 3. This is the most important question. The site I am building is a generic one. It will be used in several associations for real. I can safely assume that different associations uses different fields for their databases. Is it possible that I can write an initial setup page, where the user could define the fields involved, then a customized database could be generated? Is it possible? Thanks and looking forward to you guys' replies!!!

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Access is reliable. No database is 'secure', if you mean, can it hide your data. A SQL Server install at least requires a password, I don't know if Access offers that It's probable that Access limits the number of connections. Actually, let's be clear here. You're talking about a Jet database, an MDB file. Access itself actually prefers to store data in SQL Server, if it can. Sql Server Express Edition is free, the main benefit of Access, is that an MDB is easy to deploy. I don't know if you can create an MDB in pure C#, no. You can do it using some C++ APIs, I am pretty sure, you could p/invoke those. However, it's perhaps easier to build a database that is able to store a flexible schema, or, perhaps one that stores field names apart from the column names. I mean, how generic can it be, and your code still be useful ?

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      S 1 Reply Last reply
      0
      • I Infernojericho

        Hi fellas. I am writing a association membership system for my Final Year Project. However I have a few concerns and needs some help. 1. I spoke to my professor, who saids the size of the members in the associate is around several hundreds, maybe a little over a thousand max. I wanted the simpliest database possible. Could Access be able to handle the job? Is it reliable and secure? 2. A friend of mine told me Access only allows 1 database connection at a time. Is this true? Can anyone vouch for this? 3. This is the most important question. The site I am building is a generic one. It will be used in several associations for real. I can safely assume that different associations uses different fields for their databases. Is it possible that I can write an initial setup page, where the user could define the fields involved, then a customized database could be generated? Is it possible? Thanks and looking forward to you guys' replies!!!

        T Offline
        T Offline
        Talal Sultan
        wrote on last edited by
        #3

        Hi, Well I'm not a big fan of Access so my knowledge is limited but here goes. Point 1: Access will handle well the data and I think it will be reliable. For security, it will use a username and a password like an SQL database. Now, the problem with Access in my opinion is that it's just one file. So any mistake in file manipulation and it can just be deleted. Point 2: I don't know honestly but I would be surprised if it was true... Point 3: In my opinion, you cannot do anything on that level but I could be wrong. I don't know if you can create tables on the fly, maybe with VBScript or something. I know that in SQL Server, you can use SQL scripts to do that. Finally, in my opinion, it is never a good idea to have a dynamic database like that. I think it will be a big mess to write code to insert and update records for that kind of implementation. But that's just my opinion :) Talal

        -- If this is a post that has been helpful to you, please vote for it. Thank you! "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook

        I 1 Reply Last reply
        0
        • T Talal Sultan

          Hi, Well I'm not a big fan of Access so my knowledge is limited but here goes. Point 1: Access will handle well the data and I think it will be reliable. For security, it will use a username and a password like an SQL database. Now, the problem with Access in my opinion is that it's just one file. So any mistake in file manipulation and it can just be deleted. Point 2: I don't know honestly but I would be surprised if it was true... Point 3: In my opinion, you cannot do anything on that level but I could be wrong. I don't know if you can create tables on the fly, maybe with VBScript or something. I know that in SQL Server, you can use SQL scripts to do that. Finally, in my opinion, it is never a good idea to have a dynamic database like that. I think it will be a big mess to write code to insert and update records for that kind of implementation. But that's just my opinion :) Talal

          -- If this is a post that has been helpful to you, please vote for it. Thank you! "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook

          I Offline
          I Offline
          Infernojericho
          wrote on last edited by
          #4

          Hi there for all the replies. However it seems there are more and more question marks for now. The reason I choose Access is because of simplicity, everything is stored in a file; all I have to is upload a file and voila. What happens if I had 2 people accessing the same piece of data, and coincidently modifying it at the exact same time (with Access). Could the results be disastrous? How exactly does those M$ SQL Server and Oracle work? How do I upload the database to the webserver. Is there any database files (as with Access?) for SQL Server? I've been long baffled by the this. And is M$ SQL server free for download? I also spoke to someone else, he said I could give SQL-Lite a try, exactly what is it? I can assume that I am able to create databases on the fly with SQL Server? Thanks a big bunch for the replies!!! :)

          C J J 3 Replies Last reply
          0
          • I Infernojericho

            Hi there for all the replies. However it seems there are more and more question marks for now. The reason I choose Access is because of simplicity, everything is stored in a file; all I have to is upload a file and voila. What happens if I had 2 people accessing the same piece of data, and coincidently modifying it at the exact same time (with Access). Could the results be disastrous? How exactly does those M$ SQL Server and Oracle work? How do I upload the database to the webserver. Is there any database files (as with Access?) for SQL Server? I've been long baffled by the this. And is M$ SQL server free for download? I also spoke to someone else, he said I could give SQL-Lite a try, exactly what is it? I can assume that I am able to create databases on the fly with SQL Server? Thanks a big bunch for the replies!!! :)

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Infernojericho wrote:

            The reason I choose Access is because of simplicity, everything is stored in a file; all I have to is upload a file and voila.

            Yes, that's all it has going for it.

            Infernojericho wrote:

            Could the results be disastrous?

            I'm not really sure what concurrency support Access has, how many users are you thinking of ? More than one user, implies that this is a distributed app, so it probably makes sense to consider setting up a SQL Server instance on the server. Having the DB on the server negates any question of security, it's access to the server that is your first line of defence there.

            Infernojericho wrote:

            How exactly does those M$ SQL Server and Oracle work?

            They use services to run their main program, and they also create just a data file, the difference is simply that the main DB has to be connected to it.

            Infernojericho wrote:

            How do I upload the database to the webserver.

            The way I do it, when I have to, is to do a backup of my local DB, then copy the file to the server, terminal services in, and use the local SQL Server to restore my backup file.

            Infernojericho wrote:

            And is M$ SQL server free for download?

            SQL Server is actually cheap, compared to Oracle, but it's quite expensive, in real terms. As I said previously, SS Express is free, it only allows 5 connections or something, tho. If this is a web app, and you get it hosted, you may want to look into MySQL, just because a lot of hosts support it, I believe. But, I am sure you can find hosts with SQL Server hosting.

            Infernojericho wrote:

            I also spoke to someone else, he said I could give SQL-Lite a try, exactly what is it?

            Never heard of it, could he mean SQL Server Express ?

            Infernojericho wrote:

            I can assume that I am able to create databases on the fly with SQL Server?

            SQL Server is a real database, Access isn't quite. You can run any SQL you like on a SQL Server instance, and you can write SQL to create any database.

            Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of

            T 1 Reply Last reply
            0
            • I Infernojericho

              Hi there for all the replies. However it seems there are more and more question marks for now. The reason I choose Access is because of simplicity, everything is stored in a file; all I have to is upload a file and voila. What happens if I had 2 people accessing the same piece of data, and coincidently modifying it at the exact same time (with Access). Could the results be disastrous? How exactly does those M$ SQL Server and Oracle work? How do I upload the database to the webserver. Is there any database files (as with Access?) for SQL Server? I've been long baffled by the this. And is M$ SQL server free for download? I also spoke to someone else, he said I could give SQL-Lite a try, exactly what is it? I can assume that I am able to create databases on the fly with SQL Server? Thanks a big bunch for the replies!!! :)

              J Offline
              J Offline
              JoeSharp
              wrote on last edited by
              #6

              hi Infernojericho wrote: Could the results be disastrous? if 2 users accessing the same piece of data are you responsible to handle this, access do not support transaction's. the maximum users allowed in access are 256. look at the *.ldb file created by access. this file is created every time a user open a *.MDB database if the file exist, the user is added to it. the file-structure is limited to 256 records. each record contains the user name, machine name and any table-loking. regards

              1 Reply Last reply
              0
              • I Infernojericho

                Hi there for all the replies. However it seems there are more and more question marks for now. The reason I choose Access is because of simplicity, everything is stored in a file; all I have to is upload a file and voila. What happens if I had 2 people accessing the same piece of data, and coincidently modifying it at the exact same time (with Access). Could the results be disastrous? How exactly does those M$ SQL Server and Oracle work? How do I upload the database to the webserver. Is there any database files (as with Access?) for SQL Server? I've been long baffled by the this. And is M$ SQL server free for download? I also spoke to someone else, he said I could give SQL-Lite a try, exactly what is it? I can assume that I am able to create databases on the fly with SQL Server? Thanks a big bunch for the replies!!! :)

                J Offline
                J Offline
                J4amieC
                wrote on last edited by
                #7

                Infernojericho wrote:

                The reason I choose Access is because of simplicity, everything is stored in a file; all I have to is upload a file and voila.

                True, but the basics of SQL Server are not much different from the basics of Access.

                Infernojericho wrote:

                What happens if I had 2 people accessing the same piece of data, and coincidently modifying it at the exact same time (with Access). Could the results be disastrous?

                This is an issue for all databases. If 2 users try to concurrently write records in SQL its just as problematic. You must deal with concurrency issues whatever database you choose.

                Infernojericho wrote:

                ow do I upload the database to the webserver. Is there any database files (as with Access?) for SQL Server? I've been long baffled by the this. And is M$ SQL server free for download?

                Using the term "M$" looks childish. Microsoft is a corporation and just like all corps they like making $$$. Choose MySQL or some other open source database if you are offended by a commercial entity making money! In answer to your question. There are database files with SQL Server in a similar way to access. There are 2 files representing the database and the transaction log - it is NOT just a case of copying them to a server though - they must be attached to an instance of a running SQL Server. You can also backup your local copy (used in development) and restore that to the sql server instance at your hosting provider. SQL Server express edition (a cut-down local version of the server but fully featured) is free.

                Infernojericho wrote:

                I also spoke to someone else, he said I could give SQL-Lite a try, exactly what is it?

                A competing product for the likes of SQL Server express.

                Infernojericho wrote:

                I can assume that I am able to create databases on the fly with SQL Server?

                You can, but as you've already been advised its a really really really bad idea! Read up on defining a database schema that is dynamic by design.

                --- How to get answers to your questions[

                1 Reply Last reply
                0
                • C Christian Graus

                  Infernojericho wrote:

                  The reason I choose Access is because of simplicity, everything is stored in a file; all I have to is upload a file and voila.

                  Yes, that's all it has going for it.

                  Infernojericho wrote:

                  Could the results be disastrous?

                  I'm not really sure what concurrency support Access has, how many users are you thinking of ? More than one user, implies that this is a distributed app, so it probably makes sense to consider setting up a SQL Server instance on the server. Having the DB on the server negates any question of security, it's access to the server that is your first line of defence there.

                  Infernojericho wrote:

                  How exactly does those M$ SQL Server and Oracle work?

                  They use services to run their main program, and they also create just a data file, the difference is simply that the main DB has to be connected to it.

                  Infernojericho wrote:

                  How do I upload the database to the webserver.

                  The way I do it, when I have to, is to do a backup of my local DB, then copy the file to the server, terminal services in, and use the local SQL Server to restore my backup file.

                  Infernojericho wrote:

                  And is M$ SQL server free for download?

                  SQL Server is actually cheap, compared to Oracle, but it's quite expensive, in real terms. As I said previously, SS Express is free, it only allows 5 connections or something, tho. If this is a web app, and you get it hosted, you may want to look into MySQL, just because a lot of hosts support it, I believe. But, I am sure you can find hosts with SQL Server hosting.

                  Infernojericho wrote:

                  I also spoke to someone else, he said I could give SQL-Lite a try, exactly what is it?

                  Never heard of it, could he mean SQL Server Express ?

                  Infernojericho wrote:

                  I can assume that I am able to create databases on the fly with SQL Server?

                  SQL Server is a real database, Access isn't quite. You can run any SQL you like on a SQL Server instance, and you can write SQL to create any database.

                  Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of

                  T Offline
                  T Offline
                  Talal Sultan
                  wrote on last edited by
                  #8

                  Hi,

                  Christian Graus wrote:

                  The way I do it, when I have to, is to do a backup of my local DB, then copy the file to the server, terminal services in, and use the local SQL Server to restore my backup file.

                  I have a question concerning that matter. I know it's not the right thread or forum maybe but since you mentionned it... I ran into that problem. I had my SQL Server 2005 database on the dev server and we wanted to copy the data to the testing server. The first thing I thought of was backup and restore but it didn't work. :doh: The backup went well but when i took the file and tried restoring, it kept saying that this backup file was not made for that database. I was wondering if there are special flags or configurations to set for it to work. The way I did it was just to have the same database on both sides, i.e. same tables (but empty) and same stored procedures. And then I ran the backup procedure with the default settings. Could you please tell me what might be wrong? Thanks :)

                  -- If this is a post that has been helpful to you, please vote for it. Thank you! "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook

                  1 Reply Last reply
                  0
                  • C Christian Graus

                    Access is reliable. No database is 'secure', if you mean, can it hide your data. A SQL Server install at least requires a password, I don't know if Access offers that It's probable that Access limits the number of connections. Actually, let's be clear here. You're talking about a Jet database, an MDB file. Access itself actually prefers to store data in SQL Server, if it can. Sql Server Express Edition is free, the main benefit of Access, is that an MDB is easy to deploy. I don't know if you can create an MDB in pure C#, no. You can do it using some C++ APIs, I am pretty sure, you could p/invoke those. However, it's perhaps easier to build a database that is able to store a flexible schema, or, perhaps one that stores field names apart from the column names. I mean, how generic can it be, and your code still be useful ?

                    Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

                    S Offline
                    S Offline
                    Syed Mujtaba Hassan
                    wrote on last edited by
                    #9

                    Wel I am sory I cant tell you exact code but I have seen a .Net project by one of my classmate who generated an Access database through c# code. I mean its possible. If I find that code I'll surely post it here. But try to google it out you'll find it.

                    Mujtaba

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups