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
Highlighted

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
(1,805 Views)
Highlighted

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


aputman
LabVIEW 2017
LabVIEW Programming
0 Kudos
Message 2 of 9
(1,797 Views)
Highlighted

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
(1,788 Views)
Highlighted

Be more specific.  32 or 64 bit?


aputman
LabVIEW 2017
LabVIEW Programming
0 Kudos
Message 4 of 9
(1,786 Views)
Highlighted

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

0 Kudos
Message 5 of 9
(1,785 Views)
Highlighted

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
(1,784 Views)
Highlighted
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
LabVIEW 2017
LabVIEW Programming
Message 7 of 9
(1,774 Views)
Highlighted

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
(1,767 Views)
Highlighted

@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
(1,750 Views)