[Ironpython-users] Ccalling c# from python script

Vernon Cole vernondcole at gmail.com
Sat Oct 8 07:49:15 CEST 2011


I spotted the error just after I hit "Send" ...
line 4 should have escaped the backslashes in the Windows-format filename
string, like:
    dbFile = r"C:\MyPath\MyGDB.mdb"
or alternatively, use forward slashes
    dbFile = "C:/MyPath/MyGDB.mdb"
--
Vernon

On Fri, Oct 7, 2011 at 11:39 PM, Vernon Cole <vernondcole at gmail.com> wrote:

> Justin:
>   May I humbly suggest that rather than calling a very nasty Visual Basic
> routine, you could do the entire thing in Python more simply.
> The following example uses an SQL query to obtain the same information as
> the VB you supplied (if I understood the VB correctly.)
> I think you'll find the Python a bit easier to read.
> --
> Vernon
> <code>
> def ListUniqueRecords():
>     import adodbapi as db
>     connection_string = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s'
>     dbFile = "C:\MyPath\MyGDB.mdb"
>
<snip>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20111007/14243eb5/attachment.html>


More information about the Ironpython-users mailing list