cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid user ID or password (-103)

1,391

Good day for you!

After creating DSN record (odbcad32.exe) and checking connection i have "connection successful" answer.

alt text

But if i trying to connect with vbs, i have the next error: "Microsoft OLE DB Provider for ODBC Drivers: [SAP][ODBC Driver][SQL Anywhere]Invalid user ID or password"

cat odbc_test.vbs

Code:

Set conn = CreateObject("ADODB.Connection")
conn.Open "DSN=TEST;UID=dba;PWD=sql;"
WScript.Echo "Connected."

What am I doing wrong?

The error is reproduced on windows 10 x64 and windows 11 arm.

Other details (added):

sajdbc4.jar + java and the same credentials works fine

java + jconn4.jar - "Invalid user id"

python + JayDeBeApi + sajdbc4.jar - "Invalid user id"

odbc drivers - "Invalid user id" (python/vbs)

Github issue: link

Accepted Solutions (0)

Answers (1)

Answers (1)

VolkerBarth
Contributor

Another very very very wild guess: Is there a particular login_procedure defined for that particular database? - Simply because such a procedure could be coded to check the usage of particular applications or APIs based on checking connection_property('AppInfo'), connection_property('ClientLibrary') or the like and reject undesired access (even with correct credentials) via SQLE_INVALID_LOGON...

0 Kudos

I think this is very close to the truth.

Because the difference between "java + sajdbc4.jar" and "python + JayDeBeApi (middle layer for jdbc) + sajdbc4.jar" is only in the executable.

I'll try to clarify this point with the administrator of database with problem

Thank you very much!

0 Kudos

Maybe you know a way to test this guess?

As an example: change any connection string argument and make java+sajdbc4.jar also unusable.

VolkerBarth
Contributor
0 Kudos

Well, when successfully connected, you can check whether the login_procedure is set or not. If it is then you might check the source of the according procedure in SYSPROC (unless access is restricted or code is hidden).

If it is and you aren't allowed or able to get the procedure'code, well, then you are probably limited to black box testing because... well, it could do whatever the coder has made it do...

If you suspect it checks the application's path/name, varying this with working vs. currently not working apps would seem worthwhile to test.

Note, I have never needed such tests, so what do I know:)

jack_schueler
Product and Topic Expert
Product and Topic Expert
0 Kudos

Assuming you can connect, this one line command will tell you if a login_procedure is set.

dbisql -c "uid=DBA;PWD=sql" select connection_property('login_procedure')

The default is "sp_login_environment".

'secadm.sec_login'

Well. I guess we made sure.