Solved

ODBC Link failing when opening the database from Code

Posted on 2013-10-31
4
270 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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

690 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