Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2003
    Posts
    223

    Unanswered: User ID and password for importing Access table

    Hello, everyone:

    I know it is a simple question. I am writing a query to import a table (MyTable) from an Access Database (MyDatabase.mdb). MyDatabase.mdb is in C:\ in local. This is the query from BOL.

    SELECT a.*
    FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'c:\MyDatabase.mdb';'admin';'mypwd', MyTable) AS a

    By BOL, admin and mypwd should be user_ID and password. But I am doing testing in local, and don't set user_ID and password. How to handle two things.

    Thanks

    YTZ

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    I think this is refering to the userid and pwd in the access mdb which are optional and may not exist.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Mar 2003
    Posts
    223
    Thanks Sean. If user ID and password are not existing, how to fill in them?

  4. #4
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    try empty strings like ''
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  5. #5
    Join Date
    Mar 2003
    Posts
    223
    Thanks Sean:

    Cannot run with '', and get error,

    Server: Msg 7399, Level 16, State 1, Line 1
    OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. Authentication failed.
    OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80040e4d: Authentication failed.].

    YTZ

  6. #6
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    Null? I am not sure. I have not linked to an access database in a long time.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  7. #7
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Ok, and good lord I don't believe I'm saying this...

    Use DTS

    Or

    save the data out of the Access database as a tb delimited file and bcp it in to sql server
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

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