Re: Query "INSER INTO" with password on databases (Access)

From: Victor Koch ("Victor)
Date: 01/21/05

  • Next message: Marc G: "Fields not longer available when subclassing the _RecordsetPtr cla"
    Date: Fri, 21 Jan 2005 18:08:08 -0300
    
    

    Hi ntex, try this

    Dim Cn as ADODB.Connection
    Set Cn = new adodb.connection
    Dim Sql as string

    'open target database
    Cn.Open "Provider=............................."

    Sql="INSERT INTO mytable SELECT * FROM [MS
    Access;DATABASE=D:\Incoming\z.mdb;PWD=password].[mytable]"

    Cn.Execute Sql,,adcmdtext

    --
     Víctor Koch.
    "ntex" <m> escribió en el mensaje
    news:eqoP0S$$EHA.2984@TK2MSFTNGP09.phx.gbl...
    > I have nasty problem I need to use a query to insert records from a table
    to
    > another table (access) but, both tables have passwords, I'm using VB6
    > through ADO, but I can't make it, always have an error, if I put the
    > password gives an error on syntax "insert into", if I don't of course
    gives
    > an error that is invalid password.
    > Example of SQL used:
    >
    > INSERT INTO [;PWD=password].TableZ ( Field1, Field2 ) IN
    > 'D:\Incoming\z.mdb'[;PWD=password]
    > SELECT Field1, Field2 FROM TableX;
    >
    > Can anyone give me a hand. Thanks.
    >
    >
    

  • Next message: Marc G: "Fields not longer available when subclassing the _RecordsetPtr cla"