aivars wrote:
> Hello,
> basically I rewrote an example by Mark Hammond trying to create a
> simple trial COM server as per his Python programming on Win32 book
> The problem is that when run from VB6 (Excel VBA) it gives me an error
>
> exceptions.typeerror
> ReturnAmount() takes no arguments (1 given)
>
It's true that your ReturnAmount function takes no arguments. How did
you call it?
> con = sqlite3.connect("e://pythonexamples//aivars2.db")
>
If you use forward slashes, just use one at a time. If you use backward
slashes, THEN you need to double them.
> cur = con.cursor()
>
> konts='71302'
> d1='2008-01-01'
> d2='2008-09-30'
>
> cur.execute("select coalesce(sum(summa),0) as AD from so2
> where deb = (?) and date(datums) between (?) and (?)", \
> (konts, d1, d2))
>
sqlite3 uses the ? method of parameter substitution. You don't need
those extra parentheses (that is, use ? not (?) ). Also, you don't need
the backslash at end of line; Python will keep continuing the statement
as long as you are inside an open set of parentheses.
--
Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32