By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,064 Members | 1,388 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,064 IT Pros & Developers. It's quick & easy.

when i select a 26 digits ,the sql doesn't work ,why?

P: 2
sql='select * from usagestatistics where userID='+'\''+userID+'\''

this command couldn't work.
the error is:
Traceback (most recent call last):
File "", line 13, in ?
rs.Open('['+sql+']',conn,1,3) #1和3是常数.代表adOpenKeyset 和adLockOptimistadLockOptimistic
File "<COMObject ADODB.Recordset>", line 4, in Open
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft JET Database Engine', "Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.", None, 5003129, -2147217900), None)

but if the userID is '7552538560385152' ,my program works successfully

do you know why?
Sep 1 '06 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 1,418
Maybe because the type of the USEr_ID is longinteger and 26 digits aren't longinteger and your digits bagin with 00000 not with natural number
Sep 1 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.