Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-13-2015, 07:39 AM
Remster Remster is offline Converting VBA code to ADO Windows XP Converting VBA code to ADO Office 2003
Novice
Converting VBA code to ADO
 
Join Date: Dec 2011
Posts: 4
Remster is on a distinguished road
Default Converting VBA code to ADO

Hi Folks



I've been asked to debug some VBA code from a macro in a Word document that no longer works now we've moved to Office 2010. I'm told I need to convert the code to ADO. I'm unsure what this means and I'm a little bit out of my depth. Can anyone help me with this please? Here's the code:

Code:
Sub DutyOfCare2()
 
    Dim Db As Database
    Dim WkSpace As Workspace
 
    Documents.Add Template:="cwtn.dot"
    ActiveDocument.PageSetup.HeaderDistance = 0
 
    On Error Resume Next
    Application.StatusBar = "Opening Database"
    Set WkSpace = CreateWorkspace("Contender", "", "", dbUseODBC)
    Set Db = WkSpace.OpenDatabase("Contender", dbDriverComplete, False, "ODBC;DATABASE=/usr/username/v7/databases/live/username;...;...;DSN=Contender")
 
    If BuildDutyOfCareReps(Db) Then
        Dialogs(wdDialogFilePrint).Show
 
    End If
 
    Db.Close
 
    Application.StatusBar = "Ready"
 
    ActiveDocument.Saved = True
 
End Sub
Thanks

Remster

Last edited by Remster; 02-14-2015 at 01:31 AM. Reason: UserID & Password in code changed
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting Q and A to database jscgdunn Word 1 04-11-2014 05:29 PM
Converting VBA code to ADO converting mm.s format to mm:ss derohanes Excel 12 10-30-2012 08:34 AM
Converting hh:mm to hours Sammael Excel 2 04-17-2012 01:33 PM
Error converting to PDF danx1000 Word 1 04-03-2012 04:58 PM
Converting ACT to Outlook tabletop Office 1 01-26-2012 09:39 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:26 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft