DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2006

    how to update access database without sql

    I have a courseework, that prohibits usage of sql within the code.
    I have objects in array list. I have a connection to the Access table. How can i store the data from my arraylist into the table in Access.
    I tried the following but it didn't work:

    dataset.Tenant.Clear() ' tenant is the name of the table in access

    For i = 0 To tenantList.Count - 1
    dataset.Tenant.Item(i).tenantId = tenantList.Item(i).tenantno
    dataset.Tenant.Item(i).firstName = tenantList.Item(i).tenantfname
    dataset.Tenant.Item(i).lastName = tenantList.Item(i).tenantlname
    dataset.Tenant.Item(i).tenantType = tenantList.Item(i).tenanttype


    the following does not work either:

    for i = 0 to tenantList.Count - 1
    dataset.Tenant.AddTenantRow(tenantList.Item(i).tenantfname, tenantList.Item(i).tenantlname, tenantList.Item(i).tenantno, tenantList.Item(i).tenanttype)

    can anybody help me?

  2. #2
    Join Date
    Dec 2003
    What do you mean by "doesn't work"? Do you get an error?

    BTW, the DataAdapter InsertCommand property will require a SQL INSERT statement if you want to add data to the table in your database.
    Microsoft MVP (Visual Basic)

  3. #3
    Join Date
    Apr 2006
    By "does not work" I mean that the data in the Access table remain unchanged. I know that insert statement is required here. The point of our coursework is not to use SQL to bind textboxes to dataset's tables. For this purpose we need first to load the data from the table into arraylist and then after manipulation, upload it back. For uploading we can use SQL, but it still does not work (does not upload the data). Maybe I have some errors in my code or smth is missing. Maybe you know any tutorials on this topic, where i can learn the steps, how to load/upload data in a right way, cause I am using only one book professional VB.Net. and ther is no sufficient information on this topic.

  4. #4
    Join Date
    Dec 2003
    There are a number of ways to do this. The following MS KB article may help:

    How to use Microsoft Visual Basic .NET to connect to a Microsoft Access database and to retrieve data
    Microsoft MVP (Visual Basic)

Similar Threads

  1. find version & service packs
    By rperez in forum Database
    Replies: 5
    Last Post: 01-02-2009, 04:14 PM
  2. sql database update
    By ksuwanto8ksd in forum VB Classic
    Replies: 1
    Last Post: 06-14-2005, 02:42 PM
  3. MS-Access Error - Obsolet Database Format !
    By Makl. Lemmertz in forum VB Classic
    Replies: 2
    Last Post: 10-29-2001, 11:12 AM
  4. Access to SQL server
    By Nate in forum Database
    Replies: 29
    Last Post: 05-09-2001, 10:04 AM
  5. converse asp code for access database from sql
    By deane in forum authorevents.mitchell
    Replies: 0
    Last Post: 10-16-2000, 10:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.