Select into table in another database that is password protected?

后端 未结 2 1044
天涯浪人
天涯浪人 2021-01-14 12:14

In Microsoft Access 2003 and Visual Basic 6 I\'m trying to copy a table to another access database that is password protected like this...

Select * INTO tabl         


        
2条回答
  •  执笔经年
    2021-01-14 12:46

    How about:

    SELECT * INTO Table2 IN '' [MS Access;PWD=TestPass;DATABASE=C:\Docs\database2.mdb]
    FROM Table1
    

    These days I would be more inclined to use something like the line below, it gives more control and allows for different back-ends:

    SELECT * INTO Table2 FROM [MS Access;PWD=password;DATABASE=C:\Docs\database2.mdb].Table1
    

    You can put any valid connection string between the square brackets.

    Reference: http://www.connectionstrings.com/

提交回复
热议问题