LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Local SQL Database & Labview communication

Solved!
Go to solution

I created an sql database with sql server 2008 R2. I wish to be able to insert data to this database locally. Can someone please tell me if this can be done, and if it is possible, could someone give me the steps I have to follow?

Thanks.

0 Kudos
Message 1 of 11
(4,371 Views)
Of course it can be done. You connect to the server it creates and it doesn't matter if the server is running locally or on a network. You can purchase the Database Connectivity Toolkit from NI which hides a lot of the SQL commands. There are also free options such as LabSQL and others. Search and you'll find numerous posts on this subject.
0 Kudos
Message 2 of 11
(4,359 Views)

Please tell me how can I get this done.

Please give me some sample code or an example I could look at or maybe a website.

Thanks!

0 Kudos
Message 3 of 11
(4,345 Views)
There are examples with the toolkit If you intend to purchase that. There are examples that come with LabSQL. Did you search the boards yourself?
0 Kudos
Message 4 of 11
(4,339 Views)
Another source of information would be a 3 part series on databases (check the link in my signature). The process is largely the same regardless of the DBMS you are accessing.

With SQL Server you will need a user I'd and password. Did you install the SQL Server yourself?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 11
(4,327 Views)

The way to fix this, is by going to the windows services and starting the sql services that are stopped. this way you will be able to detect the sql server in your computer (I'm using sql server express) in odbc, and then you can connect to the instance in odbc with labview.

The problem I'm having now is that when the application tries to open the database, I receive errorcode -2147467259.

I'm using the database connectivity toolkit.

Can someone please tell me how to fix this error?

Thanks!

0 Kudos
Message 6 of 11
(4,325 Views)

Not without seeing your code...

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 11
(4,318 Views)

Hey... 

 

As mentioned before;; take a look at Help>>Find Examples and write database. 

There are great examples that ship with LabVIEW. 

 

You can also find them in our community... this one may work

 

Cheers

0 Kudos
Message 8 of 11
(4,283 Views)
Why didn't you mention all of this in your original post? Why be so vague and waste time?

The error is not being generated by LabVIEW and you can get an explanation by using Google to search for it. You really need to provide some more details as to how you are creating the connection. UDL, ODBC Administrator?
0 Kudos
Message 9 of 11
(4,265 Views)
Solution
Accepted by topic author Nando88

I fixed my problem.

The way I fixed it, is by doing the following:

1. start all sql services in windows services

2. navigate to C:\Windows\SysWOW64, and look for odbcad32

3. open this file

4. click on system dsn, click add, and add an sql server

5. fill in all the configuration and select the .sql

The problem I was having was an architecture problem, because I'm using windows 7 x64 and I created the reference in odbc, using the 32 bit odbc.

Message 10 of 11
(4,252 Views)