11-16-2016 10:52 AM
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:
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?
Solved! Go to Solution.
11-16-2016 11:20 AM
Can't read anything in your picture. What OS are you using?
11-16-2016 11:30 AM
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
11-16-2016 11:32 AM
Be more specific. 32 or 64 bit?
11-16-2016 11:32 AM
should have previewed that reply -- the 😄 were inserted for ": D" without the space
11-16-2016 11:34 AM
The development machine is 64bit. I am using 32bit LabVIEW. I don't know if the second PC is 32 or 64bit.
11-16-2016 11:41 AM
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.
11-16-2016 11:55 AM
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.
11-16-2016 12:58 PM
@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