Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

*.sdf database access

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


page3d at gmail

Apr 19, 2012, 1:18 PM

Post #1 of 2 (386 views)
Permalink
*.sdf database access

Hi, I am trying to connect and access data in a *.sdf file on Win7
system using Python 2.7. I have three questions:

1. What python module should I use? I have looked at sqlite3 and
pyodbc. However, I can seem to get the connection to the database file
setup properly.

2. How can I determine the appropriate connection string? I have
opened database file in Visual Studio and can see the tables. I don't
understand where to find the connection string in Visual Studio.

3. Assuming a module from (1) above, does anyone have a code snippet
for connecting to the database and then accessing a varbinary (image)
in one of the tables of the databese?

Thanks in advance. Dave
--
http://mail.python.org/mailman/listinfo/python-list


alex at moreati

Apr 21, 2012, 3:55 AM

Post #2 of 2 (373 views)
Permalink
Re: *.sdf database access [In reply to]

On Apr 19, 9:18 pm, Page3D <pag...@gmail.com> wrote:
> Hi, I am trying to connect and access data in a *.sdf file on Win7
> system using Python 2.7. I have three questions:
>
> 1. What python module should I use? I have looked at sqlite3 and
> pyodbc. However, I can seem to get the connection to the database file
> setup properly.

I assume you mean SQL Server Compact by *.sdf. However please note
that there are several several file formats matching SDF
http://en.wikipedia.org/wiki/SDF#Computing and explicit is better than
implicit.

The sqlite3 module won't help - that's for sqlite files, which an
entirely different file format. Wikpedia says of SQL Server Compact
"An ODBC driver for SQL CE does not exist, and one is not planned
either. Native applications may use SQL CE via OLE DB"
http://en.wikipedia.org/wiki/SQL_Server_Compact. I believe the
adodbapi module, part of PyWin32 http://sourceforge.net/projects/pywin32/files/
can connect over OLE DB.

> 2. How can I determine the appropriate connection string? I have
> opened database file in Visual Studio and can see the tables. I don't
> understand where to find the connection string in Visual Studio.

These look promising http://www.connectionstrings.com/sql-server-2005-ce

> 3. Assuming a module from (1) above, does anyone have a code snippet
> for connecting to the database and then accessing a varbinary (image)
> in one of the tables of the databese?

Pass, I'm afraid

Regards, Alex
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.