?
Solved

ODBC Link failing when opening the database from Code

Posted on 2013-10-31
4
Medium Priority
?
274 Views
Last Modified: 2013-11-12
I have an Access front-end to SQL Server back-end.

Additionally there is an ODBC link to our accounts package, Sage.

When I open the database by double-clicking the icon, it all works fine.

However, I get the database to open automatically from a procedure in Excel to make it easier for the users. When this happens the ODBC link to Sage fails.

Does anyone have any ideas why opening the database from code breaks the link to Sage?

Thanks
0
Comment
Question by:LJKMartin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 

Author Comment

by:LJKMartin
ID: 39614395
This is the code in Excel:  

Set accObj = CreateObject("access.application")
        Set FSO = CreateObject("Scripting.FileSystemObject")
        If FSO.FileExists(Environ("Userprofile") & "\Desktop\XMLSubmit.laccdb") Then
            AppActivate ("Microsoft Access - XMLSubmit")
            If Not accObj Is Nothing Then
                With accObj
                    .docmd.openform "frmProcessOrders", , , "[f1cSCOrder]= '" & stSCOrd & "'"
                    .UserControl = True
                .Forms!frmprocessorders!txtchecklist.Value = stFailValidation
                End With
            End If
        Else
            Set accObj = CreateObject("access.application")
            accObj.OpenCurrentDatabase Environ("UserProfile") & "\Desktop\XMLSubmit.accdb"
        End If
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 39615977
Let's see, you are connecting from Excell to an Access DB to connect to to a SQL DB?

Why not go direct from Excel to the SQL Server?
0
 

Accepted Solution

by:
LJKMartin earned 0 total points
ID: 39630763
Thanks for thinking about this.

The administrators of the Sage program suspect that it's being slow to respond, so the problem is nothing that I can change.

Thanks again.
0
 

Author Closing Comment

by:LJKMartin
ID: 39641074
The problem is probably to be something outside my control
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question