tags:

views:

157

answers:

2

I need to connect to an Ingres supplied demodb through OpenAPI, both Ingres and C application running on windows. What i have done:

  1. Created a "node" in the Ingres Network Utility named "usernode".
  2. created user accounts in the Ingres installation (named "user" password "user") and in the Windows user management (the same creds.)
  3. Granted necessary privileges to the user in the database.
  4. 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?

A: 
  1. You must create an account WITH password in the OS.
  2. You must create a node with SAME username and password as in the OS. Don't forget to assign the "Remote Node" parameter in the "Connection Information" block to "localhost" (!) for example. It is an REAL ADDRESS(!). "Listen Address" parameter converts to a port internally. Leave it "II".
  3. In the VDBA you, probably, have created an "user" account WITHIN THE ADMIN NODE. So, that account SHOULDN'T have ANY PASSWORD(!). You can delete it by entering existing password checking box "Delete Old Password".
  4. For an authorization, normally shold be used process' credentials.
  5. So, leave only user::demodb parameter co_target = "usernode::demodb".

Any questions?

avesus
A: 

You get the following error because your user id has not been added to the server.

"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."

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:

echo "create user USERNAME\g" | sql iidbdb

For UNIX/Linux/OS X:

sql iidbdb <<EOSQL
create user USERNAME\g
\q

Alternatively you can use a dynamic vnode in your connection such that *co_target* specifies all the connection information (including user details):

@server,protocol,listen_address[user,password]::database

for example

@localhost,tcp_ip,II[ingres,secret]::iidbdb

If you want to see a working example of OpenAPI code for Ingres take a look at the Ingres PECL extension.

grantc