LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Database Connectivity Toolkit file dns doesn't work on second PC

Solved!
Go to solution

I am using a Postgres database to save some calibration data using the Database Connectivity Toolkit.  There will be multiple calibration stations on a network all saving data to the same database.  If the network is down, each station will save calibration data to a local (and identical) database.  To make station setup easy I am using a .dsn file to connect to the local database.

 

I got the .dns file working on my development machine, but it doesn't work on the first calibration station PC.  Both machines have LV2014 as well as the same version of Postgres and the same drivers installed (I'm still working in the development environment, but will deploy as an .exe for the final implementation).  Right now I'm just trying to get the local database connection to work.  I created the database on the second PC by making a backup of the original database, and using that backup to create the database on the second PC.

 

When I try to connect on the second PC I get the following error:screen.JPG

 

I created a new .dsn file on the second PC and I get the same error.  The two .dsn files look identical. The database on the second PC has the same name and structure as the one on the development machine.

 

Here is the content of the .dsn file:

[ODBC]

DRIVER=PostgreSQL ODBC Driver(UNICODE)

UID=postgres

XaOpt=1

GssAuthUseGSS=0

LowerCaseIdentifier=0

UseServerSidePrepare=1

ByteaAsLongVarBinary=0

BI=0

TrueIsMinus1=0

UpdatableCursors=1

LFConversion=1

ExtraSysTablePrefixes=dd_

Parse=0

BoolsAsChar=1

UnknownsAsLongVarchar=0

TextAsLongVarchar=1

UseDeclareFetch=0

CommLog=0

Debug=0

MaxLongVarcharSize=8190

MaxVarcharSize=255

UnknownSizes=0

Fetch=100

ConnSettings=

ShowSystemTables=0

RowVersioning=0

ShowOidColumn=0

FakeOidIndex=0

Protocol=7.4

ReadOnly=0

SSLmode=disable

PORT=5432

SERVER=localhost

DATABASE=TAT5000data

 

Has anyone run into this before?  Any ideas on where I've gone wrong?

 

0 Kudos
Message 1 of 9
(3,690 Views)

Can't read anything in your picture.  What OS are you using?

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 9
(3,682 Views)

Windows 7.

The error reads

Error -2147467259 occurred at NI_Database_API.lvlib:DB Tools Open Connec (String).vi->NI_Database_API.lvlib:DB Tools Open Connect (Path).vi->DB test program.vi

 

Possible reason(s):

ADO Error: 0x80004005

Exception occured in Microsoft OLE DB Provider for ODBC Drivers:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified in NI_Database_API.lvlib:DB Tools Open Connec (String).vi->NI_Database_API.lvlib:DB Tools Open Connect (Path).vi->DB test program.vi

 

 

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

Be more specific.  32 or 64 bit?

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 9
(3,671 Views)

should have previewed that reply -- the 😄 were inserted for ": D" without the space

0 Kudos
Message 5 of 9
(3,670 Views)

The development machine is 64bit.  I am using 32bit LabVIEW.  I don't know if the second PC is 32 or 64bit.

0 Kudos
Message 6 of 9
(3,669 Views)
Solution
Accepted by topic author steve_morris

For 64 bit machines, when setting up a DSN, you should use the ODBC tool in the following location:

C:\Windows\SysWOW64\odbcad32.exe

I think the default shortcut in the start menu points to a different EXE and doesn't work properly.  Try the above exe and see if it works.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 7 of 9
(3,659 Views)

I will try that the next time I'm on site.

 

The DSN file worked on the 64bit machine (development machine), but did not on the second machine.  I think I got to the ODBC tool through the control panel when I made the file.  If the second machine is a 32bit machine, I will try making the DSN file using C:\Windows\System32\odbcad32.exe  also.

 

Thanks.

0 Kudos
Message 8 of 9
(3,652 Views)

@steve_morris wrote:

should have previewed that reply -- the 😄 were inserted for ": D" without the space


Fix the profile settings within the discussions forums and you won't have this problem.  See this message thread for what to do.

https://forums.ni.com/t5/Feedback-on-NI-Community/Disable-Emoticons/m-p/3340403#M13378

Message 9 of 9
(3,635 Views)