DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Phil N. Guest

    Re: deleting files

    Hi Rachel,

    May you don't understand my answer. However, you question is not quite clear
    either!

    Can you tried to re-phrase your question in clear way. If you haven't
    received help here, it maybe your questions don't provide enought
    informations to start with!

    Try your best!

    Sincerely

    Phil N.
    "Rachel Chisholm" <taurus@shentel.net> wrote in message
    news:38c8b1c8$1@news.devx.com...
    > I'm sorry but I don't understand this.
    >
    >
    > Phil N. <phil.normand@sympatico.ca> wrote in message
    > news:38c86dfd@news.devx.com...
    > > Hi Rachet,
    > >
    > > Did have a look at database after program finished?
    > > By using the "Insert Into", in DAO we add a command to add new record.

    see
    > > below for recordset example
    > >
    > > rs.database.add ' or something similar.
    > >
    > > we have to make sure the records are saved especially when value are

    being
    > > deleted from other table.
    > >
    > > Does this point you in right directions?
    > >
    > > Sincerely
    > >
    > > Phil N.
    > >
    > > Rachel Chisholm <taurus@shentel.net> wrote in message
    > > news:38c85dd0@news.devx.com...
    > > > I'm using an "Insert Into" statement to insert values into a second

    > table
    > > in
    > > > my database. I get the values from another master table in the same
    > > > database. The two tables are related. I'm using DAO.
    > > >
    > > > I need to clear all the values from the second table, on each run.

    When
    > i
    > > > run the program the first time, it works fine and takes all the values

    > > from
    > > > the master table and inserts them into the second table. But once i've
    > > > cleared the values once, it won't re-insert the values. I'm clearing

    the
    > > > table using the following:
    > > >
    > > > 'MyDB.Execute " DELETE * FROM MyTable"
    > > >
    > > > Then i try doing the INSERT INTO statement again.
    > > > i've tried putting my insert statement in different locations of the
    > > > program, but after i've deleted the files, it won't insert them again.
    > > >
    > > > What am i doing wrong?
    > > >
    > > > Rachel
    > > >
    > > >
    > > >

    > >
    > >

    >
    >




  2. #2
    Lenny Toulson Guest

    Re: deleting files

    Tell me if this is what you're trying to accomplish:

    Public Sub Foo()
    Call DeleteRecords()
    Call AddNewRecords()
    End Sub

    Public Sub DeleteRecords()
    Dim strSQL As String

    ' use either a local-, module-
    ' or global-level DAO database object -
    ' I'll call mine ddbFoo

    strSQL = "DELETE FROM Table2"
    ddbFoo.Execute strSQL
    End Sub

    Public Sub AddNewRecords()
    Dim strSQL As String

    strSQL = "INSERT INTO Table2 (SELECT * FROM Table1)"
    ddbFoo.Execute strSQL
    End Sub

    --
    Lenny
    __________


    Rachel Chisholm <taurus@shentel.net> wrote in message
    news:38c85dd0@news.devx.com...

    I need to clear all the values from the second table, on each run. When i
    run the program the first time, it works fine and takes all the values from
    the master table and inserts them into the second table. But once i've
    cleared the values once, it won't re-insert the values. I'm clearing the
    table using the following:

    'MyDB.Execute " DELETE * FROM MyTable"

    Then i try doing the INSERT INTO statement again.
    i've tried putting my insert statement in different locations of the
    program, but after i've deleted the files, it won't insert them again.



Bookmarks

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links