Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8601429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:50:25+00:00 2026-06-12T01:50:25+00:00

I have writen a program in python ( pyodbc and tkinter ). I used

  • 0

I have writen a program in python (pyodbc and tkinter). I used pyodbc to connect to Microsoft Access Database.

There is the connection Code:

import pyodbc

# Microsoft Access Database File
DBfile = 'GDP.mdb'
conn = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb)};DBQ='+DBfile)

When I start it before compiling in command prompt (python myprogram.py) it works very well. When compiling with pyinstaller all goes well, no errors are reported.

But When trying to launch the executabl it shows the main window for 2 seconds which then disappears.

When I used the -d flag in pyinstaller to turn on debug mode it shows the following error when launching the executable:

Traceback (most recent call last):
File "<string>", line 62, in <module>
  pyodbc.Error: (
     'HY000', "[HY000] [Microsoft][Driver ODBC Microsoft Access]
     Can't find File'(Unknown)'. 
     (-1811) (SQLDriverConnect); [HY000] [Microsoft][Driver ODBC Microsoft Access]
     Can't find File'(Unknown)'.
     (-1811)")
RC: -1 from main

EDIT
first error gone , got a new one :

Traceback (most recent call last):
    File "", line 78, in 
File "path\to\my\program\ build\pyi.win32\GDP\outPYZ1.pyz/Tkinter", line 1564, in wm_iconbitmap
_tkinter.TclError: bitmap "icon.ico' not defined
RC: -1 from main
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:50:27+00:00Added an answer on June 12, 2026 at 1:50 am

    You’ll need to use an absolute filename, not a local file:

    import os
    
    try:
        currdir = os.path.dirname(os.path.abspath(__file__))
    except NameError:  # We are the main py2exe script, not a module
        import sys
        currdir = os.path.dirname(os.path.abspath(sys.argv[0]))
    DBfile = os.path.join(currdir, 'GDP.mdb')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a program in Tkinter (Python 2.7), a scrabblehelper in Norwegian which
I have a Python CLI program, with SQL database models and want to add
I have written a code in Python which accesses Mysql database in my computer.My
I have written my program in python. It is written across seven files and
I have written a Python program to find the carrier of a cell phone
I have to write a program in python where the user is given a
Well, i have written a simple python program that parses HTML with HTMLParser. Here
i have been trying to write a program in python to read two text
I have been asked to write a program using python for an assignment. I
There are many ways to write a Python program that computes a histogram. By

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.