Odbc Logging Password


muniprasad

Recommended Posts

Important point: there are two possible places for password. You can have a password on the database (MySQL, Access, etc), and/or you can have a password on the ODBC connection.

If the ODBC connection has a password on it then you can specify that in the db.open() function call. It means you can't use logging sets or standard alarm logging as these only work with non-password protected ODBC connections. Or you can just remove the ODBC password. If the database instead has a password, you need to set that in the ODBC settings in Windows. That is outside DAQFactory and usually in Windows Administrator Tools (the same place you setup your ODBC connection.)

Link to comment
Share on other sites

I created a new channel name 'Test' with OPC Server. I need to log it values in database whenever data arrived. I Have a sequence called data log . It has write new values to database. But its logging duplicates. how can i avoid to log duplicates and write new values only.

Link to comment
Share on other sites

You can put it right in the event for the channel, or create a second channel, a Test channel with Timing = 0, then in the event for the first channel put:

if (myChannel[0] != myChannel[1])

myTestChannel.addValue(myChannel[0])

endif

This will cause myTestChannel to only have values when myChannel changes. You can then put myTestChannel in your logging set.

Link to comment
Share on other sites

  • 7 years later...

Difficulty connecting to an SQL database. I've looked through posts in the forums and tried the suggested tips but still no connectivity. Any help would be most appreciated. Here's where I'm at:

DAQFactory logging set configured as below reports the error: The specified DNS contains an architecture mismatch between the driver and application

 

Logging method: ODBC database  Windows 32 bit

Authentification windows

Data source: USINE

 

DAQFactory sequence to open database reports the error: O1002 Unable to open ODBC database. I've tried several variations of the OpenEx() call, examples below. None work:

 

dbase = db.OpenEx("DSN='USINE';UID= ' ';PWD=' '")
 
Authentification Sql server
 
dbase = db.OpenEx("DSN='USINE';UID= 'Sql1 ';PWD='sa '")

 

Link to comment
Share on other sites

OK, that error usually occurs when you use a 64 ODBC driver with DAQFactory, which is a 32 bit application.  You have to make sure on 64 bit versions of Windows to run the 32 bit ODBC configuration tool.  This is often NOT listed in control panel / Administrative tools.  I usually add a shortcut to the 32 bit version manually, so it lists both.  It is usually located here:  C:\Windows\SysWOW64\ODBCCP32.CPL

 

 

Link to comment
Share on other sites

Start simple then.  Turn off authentication.  Make sure you are connecting to a local database and not trying to do this over a network.  If you have another tool available, see if it can connect over ODBC.  Or, if a Test button is available on the ODBC configuration page, check that.  Is the database local?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.