Results 1 to 3 of 3

Thread: hmmm...weird

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Location
    Philippines
    Posts
    196

    Question

    ok ok

    could somebody tell me what's I mean why is this.

    I have a dataenvironment that connects to an access db called test.mdb.
    I already have recordsets there.

    now, at run time, I want the access db file to be dynamic but with the same structure.

    so test.mdb is the same as another.mdb

    so in the Main sub,

    NOTE: equals is used here to symbolize the real equal sign. (sorry my internet pc keyboard's equal sign does not work. but it does in my Notebook)

    I have:

    with deTest.conTest
    .properties("Data Source").value equals (see NOTE remember) "d:\test\another.mdb"
    end with

    When I access the recordsets, it still accesses the test.mdb which was the one I used to create my recordsets. (get it?)

    what i did to make around,
    dim strCon as string
    with deTest.conTest
    .properties("Data Source").value equals (see NOTE remember) "d:\test\another.mdb"

    strCon equals .ConnectionString
    .ConnectionString equals strCon
    end with

    VOILA! it works already. it now accesses the another.mdb

    HHHHMMMMMM.....

    When I connect to SQL server though, I don't have to work around with it.


    [Edited by RIVES on 10-29-2000 at 12:30 PM]

  2. #2
    Lively Member
    Join Date
    Aug 2000
    Posts
    125
    I don't see any .open or .refresh

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Location
    Philippines
    Posts
    196
    it does not have to have one.

    this code is for the initializationi on where the system would connect. what database the user would use. since the dataenvironment declinic is a global object, setting its connection properties should be used by all the recordsets in it.

    I usually do this in a SQL server database. when you have the same schema on two databases (production and test databases) so that the user would choose what database to connect to.

Posting Permissions

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



Click Here to Expand Forum to Full Width