Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    5

    Unanswered: How to hardcode DNS?

    The following statement:
    DoCmd.TransferDatabase acExport, "ODBC Database", _
    "ODBC;SERVER=ServerName;UID=UserID;PWD=passwor d;" _
    & "DATABASE=NewAccounts", acTable, "tblNewAccounts", "tblNewAccounts"
    executes fine exept a user get prompt for DSN name.

    I tryed to hardcode DSN:
    DoCmd.TransferDatabase acExport, "ODBC Database", _
    "ODBC;DSN=DSNName;UID=UserID;PWD=password;" _
    & "DATABASE=NewAccounts", acTable, "tblNewAccounts", "tblNewAccounts"

    I got an Error message:
    "ODBC Connection failed"
    How can I code "exporting tables" so end user won't have poped up Server Window "Select Data Source" with which he/she is not familiar att all.
    Thanks
    Last edited by Alika; 04-30-04 at 15:39.

  2. #2
    Join Date
    Apr 2004
    Posts
    75
    Try this:
    DIM DSNconnection
    DSNconnection = "blah blah"

    That might work for hardcoding your DSN connection.... I hope... I am new to this stuff to, But I think that will work.

    breeze76
    Last edited by breeze76; 05-02-04 at 01:52.

  3. #3
    Join Date
    Mar 2004
    Posts
    5
    No I doesn't. But thanks any way for attempt to help.

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by Alika
    No I doesn't. But thanks any way for attempt to help.
    Set MyConnect = New ADODB.Connection
    Set MyRecSet = New ADODB.Recordset

    MyConnect.CursorLocation = adUseClient
    MyConnect.Open "DSN=Billing System;" ';PWD=Some Password;"
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

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