Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004

    Question Unanswered: Using Oracle as datasource for Word mailmerge from VB6

    The following connection string gives me a "datasource not found" error when applied to the .opendatasource property of a Word mailmerge object.

    gstrConWord = "DSN=" & gstrDSN & ";UID=" & gstrOraUID & ";PWD=" & gstrOraPWD

    I've done this using a SQL Server datasource but this is the first time that I needed to use Oracle.

    This is the Word part.
    With oDoc.MailMerge
    .MainDocumentType = wdFormLetters
    On Error GoTo ConErr
    .SuppressBlankLines = True
    .OpenDataSource "", , , , , , , , , , , gstrConWord, strSQLText, _
    .Destination = wdSendToNewDocument
    End With

    Any help would be appreciated.

  2. #2
    Join Date
    Mar 2004
    Did you verify that your DSN connection works when you created it? (Using the Test Connection command button)

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

  3. #3
    Join Date
    Apr 2004
    Yes, the DSN works just fine. I can even get a recordset from Oracle into my program. The problem is with the Word mailmerge. I'm trying to avoid having to save the Oracle data to a SQL Server table or a Word doc to use for the mailmerge process.

Posting Permissions

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