Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Mar 2002
    Location
    Sydney, Australia
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Destination DB Property (2000 (9.0.3821 SR1))

    Hi,

    I am developing an application in Access 2000 and am having a problem with setting the DestinationDB and sourcedatabase properties for an Append query from code.

    I have tried:

    strFilter = ahtAddFilterItem(strFilter, "Access Files (*.mdb)", "*.mdb")
    strexportFileName = ahtCommonFileOpenSave(Filter:=strFilter, OpenFile:=False, _
    DialogTitle:="Select the Benchmarking Database...", _
    Flags:=ahtOFN_HIDEREADONLY)

    queries![qry_uploadauditdetails].destinationdb = strexportFileName
    queries![qry_uploadanswers].destinationdb = strexportFileName
    queries![qry_LastUploadCompanyNumber].sourcedatabase = strexportFileName

    DoCmd.OpenQuery "qry_UploadAuditDetails"
    DoCmd.OpenQuery "qry_UploadAnswers"

    The need for this function arises from our need to benchmark audit results which will be captured by a number of people.

    At this stage, the only way I can see to get around this is to delete the existing append query and create a new one each time this is run.

    Regards and thank

    Niall Eddery

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Destination DB Property (2000 (9.0.3821 SR1))

    I don't quite understand what you're doing. I'm guessing that you're using the common dialog call to pop up the FileOpenSave dialog, but does that mean that you are NOT using linked tables? This whole thing would be easier with ADO if you are not using linked tables, but it isn't clear exactly what you're doing.
    <hr>The need for this function arises from our need to benchmark audit results which will be captured by a number of people. <hr>
    This doesn't really explain anything. Why are you trying to append data to an arbitrarily chosen database and how do you expect to guarantee that the target database even has the table you want to append to?
    Charlotte

  3. #3
    New Lounger
    Join Date
    Mar 2002
    Location
    Sydney, Australia
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Destination DB Property (2000 (9.0.3821 SR1))

    Sorry if my explanation was a bit hairy.. I'll try again;

    We have a questionnaire database that people will bring to clients with them on their laptops to complete. When they come back into the office, they will need to upload the results to a Benchmarking database. depending on which client the questionnaire was completed for and which office they check back into. I have three queries which will move the data, but my attempts to set the sourcedb and destinationdb through vba don't seem to work.

    What I would like to do is ask the user what database they wish to upload the data to (using the FileOpenSave dialog) , and then change the source or destination databases on three queries to that database. And then run those queries.

    Thanks
    Niall

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Destination DB Property (2000 (9.0.3821 SR1))

    Are these databases single mdbs, not split FE/BE? Is there a reason you're not using ADO to do this?
    Charlotte

  5. #5
    New Lounger
    Join Date
    Mar 2002
    Location
    Sydney, Australia
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Destination DB Property (2000 (9.0.3821 SR1))

    The Questionnaire DB is a single DB. The Benchmarking DB is a FE/BE Database, with all reporting being done from the FE. When staff are completing the questionnaire they won't have access to the network most of the time. In general, people doing the questionnaire will not have access to the benchmarking FE.

    At this stage I don't want to use ADO because this is getting rolled out next week, and I'm going on vacation for a month afterwards. The person who will be supporting the DB knows even less about access than I do, and any time I've played with queries and ADO, they aren't visible in the db window. Is there a way of modifying a query using ADO that will leave it visible? The non-pilot version I'll be creating when I get back should feature a bit more ADO.

    Apologies if I'm being an idiot; I've only recently started developing in access again after doing practically nothing since v2.0; and some of it (particularly ADO) hasn't quite sunk in yet.

    Ta
    Niall

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Destination DB Property (2000 (9.0.3821 SR1))

    Queries created with ADO are hidden because MDBs don't have a collection of Views or Stored Procedures and ADO doesn't know about queries. It still sound to me like it would be easier to do it a different way. Why not export the data to a mailmerge format, which is tab delimited text? You could build an import/export spec to handle the text file and then import the text files from the Benchmarking database. Otherwise I'd say it would be easier to temporarily link a table fron the target database to your questionnaire db and append to that instead of trying to set the destination database. I know others have wrested with setting a destination database, but I can't remember ever trying that method. It's always been simpler to create a temporary link. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Charlotte

Posting Permissions

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