I need to connect to an Ingres supplied demodb through OpenAPI, both Ingres and C application running on windows. What i have done:
- Created a “node” in the Ingres Network Utility named “usernode”.
- created user accounts in the Ingres installation (named “user” password “user”) and in the Windows user management (the same creds.)
- Granted necessary privileges to the user in the database.
- In C code i have called IIapi_connect() function with an IIAPI_CONNPARM structure.
Used members:
co_target = “usernode::demodb”,
co_username = “user”,
co_password = “user”
But IIapi_connect() call returns an error:
“User provided a vnode as part of the database name (vnode::dbname), but connection information for that vnode is missing. Enter connection information for the vnode using NETUTIL.”
Anybody knows something that is a weird concept “node”?
What are the minimum steps (in the database administration and the function parameters passing) necessary for the successful connect?
You get the following error because your user id has not been added to the server.
I am guessing that the user id being passed across is defined in the virtual node (aka vnode) definition and it’s that user that needs to be added to the user list on the server. The following will add a user from the command line, change USERNAME to the username you wish to add:
For Windows:
For UNIX/Linux/OS X:
Alternatively you can use a dynamic vnode in your connection such that co_target specifies all the connection information (including user details):
for example
If you want to see a working example of OpenAPI code for Ingres take a look at the Ingres PECL extension.