Results 1 to 3 of 3

Thread: TransferText in Access -> VB

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    38

    Exclamation TransferText in Access -> VB

    I'm using this code in VB to use the TransferText method from the access 2000 object...

    <
    Set objAcc = New Access.Application

    objAcc.OpenCurrentDatabase strDatabasePath, False

    objAcc.DoCmd.TransferText acExportDelim, "Nummeringen", "Nummeringen", strNummeringen
    >

    This works fine UNTIL I start using the password-security from
    the access 2000 DB...

    I just can't figure out how I can open the database using the Access object and pass the password without having a popup screen
    that askes me to enter the password.

    Does anyone know how to open a database with a password by using the Access object???

    Thx! Your help is appreciated!

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. 'add a ref to DAO
    2.  
    3. Option Explicit
    4. Private acc As Access.Application
    5.  
    6. Private Sub Command1_Click()
    7.     Dim db As DAO.Database
    8.     Set acc = New Access.Application
    9.     Set db = acc.DBEngine.OpenDatabase("C:\test.mdb", False, False, ";PWD=test")
    10.     acc.OpenCurrentDatabase "c:\test.mdb", True
    11.     db.Close
    12.     Set db = Nothing
    13.     acc.Visible = True
    14. End Sub

    think that does the job.. needs DAO thouhg...

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    38

    Smile

    Thanks Peet :-)

    I'm going to try this solution... Only one thing;
    I've already made an export-function of the data myself now
    (couldn't wait for a solution hey)...

    Thanks again!

Posting Permissions

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



Click Here to Expand Forum to Full Width