Results 1 to 5 of 5

Thread: APPEND QUERY

  1. #1
    New Lounger
    Join Date
    Dec 2000
    Location
    Calif
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    APPEND QUERY

    Im trying to append from one Access DB to another DB. If the target DB has a Pass word set the query Im trying to create wont work. When I get it all done and run it, it says No database in in clause or sum such. If I unset the PW on the target DB and then create the query it will work.
    If I then set a pass word in the target DB, when I run the query it only asks for the date parameter I have set. It will not ask for the PW. However if I open the query in design view, it asks for the password. It opens in design view and if I try to run it from there it will not ask for the PW. This is the query that works without the PW in target DB.
    INSERT INTO CoilIn ( ItemNo, Weight, Rec, Mill, [PO#], LocNo ) IN 'Amerimax1.mdb'
    SELECT tblMatics.PartNo, tblMatics.Weight, tblMatics.Date, tblMatics.Anaheim, tblMatics.PoNumber, IIf([Anaheim]="A","A" & [Lot#],[Lot#]) AS Expr1
    FROM tblMatics
    WHERE (((tblMatics.Date)=[typr Date]));
    Can anybody tell me where to put a PW in it ?
    Access just wont create a working append query if I have a PW set. Any help will be appreciated.
    For example, please use password "cary"
    Thanks Cary

  2. #2
    ghandlin
    Guest

    Re: APPEND QUERY

    You'll need to create a recordset in code and pass the username and password over via the connection. What version of Access are you using?

    [img]/w3timages/icons/woof.gif[/img]

  3. #3
    New Lounger
    Join Date
    Dec 2000
    Location
    Calif
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: APPEND QUERY

    Access 97

  4. #4
    New Lounger
    Join Date
    Dec 2000
    Location
    Calif
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: APPEND QUERY

    Well, looks like Im not going to get an answer to this one. But thanks anyway people. I have gotten a lot of good advice before from this place. Guess Ill just have to hit the books again.
    Thanks Cary

  5. #5
    ghandlin
    Guest

    Re: APPEND QUERY

    Cary,

    Sorry for the delay in getting back, I've been out for the holidays, a move and being sick!

    It's been a while since I've worked with DAO which is what you are probably using. This should get you going in the right direction though..

    Dim wks As DAO.Workspace
    Dim db As DAO.Database
    Dim rs As DAO.Recordset

    Set wks = DBEngine.CreateWorkspace("wks", "Admin", "AdminPass")
    Set db = wks.OpenDatabase("x:...Datatabse.mdb")
    Set rs = db.OpenRecordset("SQL")


    Remember to close your objects and set them to nothing.

Posting Permissions

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