LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Toolkit - UserID/Password on Access Database?

I recently installed the SQL toolkit for LW/CVI and I'm having some difficulty logging into a database with a user ID and password. I've read around on the board and tried some of the recommendations of others but still can't get the DB to initialize.

I've tried the following varations on syntax:
DBhandle = DBConnect ("DSN=DB;USER=uid;PASSWORD=pw");
DBhandle = DBConnect ("DSN=DB,USER=uid,PASSWORD=pw");
DBhandle = DBConnect ("DSN=DB;UID=uid;PW=pw");
DBhandle = DBConnect ("DSN=DB,UID=uid,PW=pw");
DBhandle = DBConnect ("DSN=DB,UID=uid\00,PW=pw\00");
DBhandle = DBConnect ("DSN=DB;UID=uid\00;PW=pw\00");

I have also set up the user ID and password for the ODBC settings under the control panel and still - nothing. Any
one have any recommendations??? I have tried creating a new database with no password and I can access it so I'm assuming either the uid/pw I have been provided is incorrect, or my syntax is wrong. I'm leaning toward the syntax as being the problem.

Thanks again guys!
0 Kudos
Message 1 of 9
(4,400 Views)
Looking at thw DBConnect function help, I see that either you can use the 'User ID' and 'Password' parameters or you can use 'UID' and 'PWD' parameters. The second option is not recognized from all drivers.

In my experience, ODBC drivers are quite snob, and the correct syntax of the keywords is relevant to them, so I suggest you to check and correct the spelling of the keywords in your command.

Hope I gave you a little help...
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 9
(4,400 Views)
Dit you find a solution ???

Would like to do the same...

thanks a lot!
0 Kudos
Message 3 of 9
(4,400 Views)

hello,I need this project,is it possible to give

0 Kudos
Message 4 of 9
(3,789 Views)
You've set a record for the number of hijacked threads and for resurrecting one of the oldest.
0 Kudos
Message 5 of 9
(3,780 Views)

I have the same problem. Nothing seems to work. I would assume the following syntax is correct:

 

myConn = DBConnect ("Provider=SEQUEL ViewPoint;User ID=JohnDoe;Password=abcd;");

 

But I get Error -10

It works without the UID/PW part.

Surely someone has figured out how to do this? 🙂

0 Kudos
Message 6 of 9
(3,408 Views)

If you look in the 2nd post, it says something about using the "UID" and "PWD" keywords, not "User ID" and "Password".  But these keywords are database driver specific so you would have to check your database driver documentation for the exact syntax. But it is very unlikely that "User ID" is a correct keyword, since it contains a space.

 

Assuming that your Provider Name "Sequel" refers to a Sybase database driver, the correct connection string would be something like "DataSource=myASEserver;Port=5000;Database=myDataBase;Uid=myUsername;Pwd=myPassword;"

 

Looking for Sequel Viewpoint the syntax seems to be

:user=>'...', :password=>'...'

for this weird driver, but the only examples I can find online seem to be for some sort of scripting language (supposedly Ruby) so this syntax may be Ruby specific.

Rolf Kalbermatter
My Blog
Message 7 of 9
(3,396 Views)

A good place to look for connection strings is https://www.connectionstrings.com/.

I found it really useful so many times Smiley Happy

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
Message 8 of 9
(3,378 Views)

Thanks, I am still checking 🙂

0 Kudos
Message 9 of 9
(3,359 Views)