×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    6

    SymbianError:[Errno -6]KErrArgument

    Hi there, I'm using the following code to open (or create and open if not the database is not present) ad then add a row to an e32db.
    The database creates fine, but the
    Code:
    db.execute(sql_add)
    line raises a
    Code:
    SymbianError:[Errno -6]KErrArgument
    error. Have I malformed the SQL statement?
    Code:
    def db_write():  
        users_db = u'e:\\python\\ssusers.db' 
        sql_create = u'CREATE TABLE users (user VARCHAR, password VARCHAR)'
        myuser = appuifw.query(u'user?', 'text')
        mypwd = appuifw.query(u'password', 'text')
        sql_add = u'INSERT INTO users (user, password) VALUES (\"' + myuser + '\", \"' + mypwd + '\")'
        try:
            db = e32db.Dbms()
            db.open(users_db)
        except:
            db.create(users_db)
            db.open(users_db)
            db.execute(sql_create)
        db.execute(sql_add)
        db.close()

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: SymbianError:[Errno -6]KErrArgument

    hello fearoffours

    basically KErrArguement is bad request error, and the only thing i can help you is to advice you to go through this link.

    Regards
    Gaba88

  3. #3
    Registered User
    Join Date
    Jul 2009
    Posts
    6

    Re: SymbianError:[Errno -6]KErrArgument

    Many thanks Gaba88, I have already looked at that article. It doesn't have any info on pulling specific rows out of the database in either e32db or e32dbm though, and nothing about KErrArgument

  4. #4
    Registered User
    Join Date
    Sep 2003
    Posts
    77

    Re: SymbianError:[Errno -6]KErrArgument

    Try to replace:
    sql_add = u'INSERT INTO users (user, password) VALUES (\"' + myuser + '\", \"' + mypwd + '\")'
    with:
    sql_add = u"INSERT INTO users (user, password) VALUES ('%s','%s')"%(myuser,mypwd)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×