10-18-2016 09:38 AM
Unfortunately I dont have 'microsoft access driver' in step 3
all that is listed in the system DSN tab when clicking 'add' is
1. SQL server
2. SQL server native client
This was orginally set up by a third party who made the test bench.
looking at his UDL file is appears to use microsoft OLE DB provider for SQL Server.
I do also recall the guy saying something about directly using SQL statments?
I hope this some how sheds some light on this issue
10-18-2016 10:55 AM
Of course you can but you don't need to use statements. It is against to LabVIEW's nature. The main advantage of LabVIEW is that you don't need to know everything about coding.
Did you install any SQL server to that computer? If not, you can download SQL Server Express 2016 from https://www.microsoft.com/en-us/download/details.aspx?id=52679.
Assume that you've installed. So let's write a similar procedure to Access.
1. Go to "Administrative Tools" in "Control Panel". Find "ODBC Data Sources (32 Bit)" and double click on it.
2. Click on "Add.." button and select "SQL Server" and then close it.
3. Write a "Data Source Name" as you wish.
4. Select the SQL server. Probably, you'll see something like "yourdomainname\SQLEXPRESS". Then click Next.
5. Click "Next", again click "Next" and close it.
6. Click "Test Data Source" and probably you'll successfully create data source file. Then close it.
7. Open LabVIEW, find "Create Data Link.." under Tools menu and open it.
8. Select "Microsoft OLE DB DB Provider for SQL Server" as a provider. After clicking next, connection tab will be opened. Select the provider listed "yourdomainname\SQLEXPRESS" and select "Use Windows NT security.." (I don't know the exact version because my OS language is not English.)
9. After you select, click on "Test Connection".
10. Again, voila.. 😉
By this way, you will be able to use the same code but different database configuration. The main reason why I'm in love with LabVIEW. 🙂
Please keep me informed.
Emre
10-19-2016 03:31 AM
Thanks Emre you've been a great source of help with this issue.
I tried the steps above however in the server selection drop down list SQL server was not in the list.
I really dont want to install more things as the testbench has not been commsioned, i'm just trying to understand and regain the orginal connection.
tbh the the VI seems odd as it calls for Table1 which actually doesnt exsit on my database that much I do know.
10-19-2016 05:30 AM
It's been a pleassure but I wish you had your problem solved. I think these procedures will guide your or anyone in the future when it is needed to build an application including database connectivity.
Emre
10-19-2016 09:13 AM
I have not had luck trying to connect to .ACCDB files. I have always used .MDB files because of this. I don't know the difference and have never taken the time to investigate. Having said that, you won't be able to connect to either dB if you don't have the proper ODBC driver installed. If you search the Microsoft website for ODBC drivers, you should find what you need.
10-19-2016 09:37 AM
Thanks for your input, the strange thing is that it was working just fine with .accdb then it just seemed to randomly stop.
The third party vendor is currently debugging via remote desktop.
It's good watch him as I can see he's trying everything I did, so for newbie I was on the right path.
10-19-2016 09:42 AM
Also keep in mind that if you are on a 64bit OS, you should use the ODBC in the SYSWOW64 folder. The one in the control panels won't work properly.
c:\Windows\SysWOW64\odbcad32.exe
10-19-2016 11:11 AM
thanks thats very helpful I can see labview in the system DSN TAB now
10-19-2016 02:15 PM
You should not use the LabVIEW DSN for your code. Add your own DSN that uses the same driver as the LabVIEW one but points to a different mdb file. If you mess around and change something in the Labview DSN, your examples that ship with Labview will stop working.
10-19-2016 02:24 PM
Yes deci, I told you to use LabVIEW data source because you can easily check what you're doing. Of course you should create your own data source for your application.
I had similar problems and I found where the problem was by doing as I said.
Emre