[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

ODBC Link failing when opening the database from Code

Posted on 2013-10-31
4
Medium Priority
?
278 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

650 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