muniprasad Posted February 15, 2013 Share Posted February 15, 2013 Sir, I created ODBC Database logger. I saved it on my local drive. While i open the file, it asks SQL server password. I want a script to set sql password to ODBC logging. So While I Logon to windows , its automatically works on without user interface. Thanking you Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted February 19, 2013 Share Posted February 19, 2013 Sorry, I'm unclear what you are asking. Do you want Windows to auto-login so DAQFactory can run, or do you need DAQFactory to provide the password automatically for your ODBC? Quote Link to comment Share on other sites More sharing options...
muniprasad Posted February 20, 2013 Author Share Posted February 20, 2013 I need DAQFactory to provide the password automatically for my ODBC Logger. So i do not need to enter password everytime When I open DAQFactory. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted February 21, 2013 Share Posted February 21, 2013 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.) Quote Link to comment Share on other sites More sharing options...
muniprasad Posted February 21, 2013 Author Share Posted February 21, 2013 Thanks, So I can not use the ODBC Logger, If the ODBC connection has a password. Am i right? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted February 21, 2013 Share Posted February 21, 2013 Correct, but only if its the ODBC connection. If its the database that has the password, then you can. Instead of the logger, you can use the DB. functions to open the database and write to it from script. Quote Link to comment Share on other sites More sharing options...
muniprasad Posted February 28, 2013 Author Share Posted February 28, 2013 Then How can i determine , A new data has entered to channel automatically. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted February 28, 2013 Share Posted February 28, 2013 You might try going into the ODBC configuration in Windows, finding your data source, and then looking for a user/password setting and seeing if you can put the user/password there. Quote Link to comment Share on other sites More sharing options...
muniprasad Posted March 1, 2013 Author Share Posted March 1, 2013 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. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted March 4, 2013 Share Posted March 4, 2013 Just compare the latest reading with the previous and only write if it changed: if (myChannel[0] != myChannel[1]) // .. log data endif Quote Link to comment Share on other sites More sharing options...
muniprasad Posted March 7, 2013 Author Share Posted March 7, 2013 if (myChannel[0] != myChannel[1]) // .. log data endif So I need to use the above frequently for Every 5 or 3 seconds. Am i right? Or is there any method? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted March 7, 2013 Share Posted March 7, 2013 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. Quote Link to comment Share on other sites More sharing options...
ouadah2007 Posted May 25, 2020 Share Posted May 25, 2020 i can't connect sql server to my daqfactory Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted May 25, 2020 Share Posted May 25, 2020 OK, I need a lot more detail to help, including what you have done, and what messages you are getting. Quote Link to comment Share on other sites More sharing options...
ouadah2007 Posted May 25, 2020 Share Posted May 25, 2020 thank you very much my brother i want to change my access database with sql server Quote Link to comment Share on other sites More sharing options...
ouadah2007 Posted May 25, 2020 Share Posted May 25, 2020 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 '") Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted May 25, 2020 Share Posted May 25, 2020 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 Quote Link to comment Share on other sites More sharing options...
ouadah2007 Posted May 26, 2020 Share Posted May 26, 2020 but i have a Windows 7 32 bit Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted May 26, 2020 Share Posted May 26, 2020 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? Quote Link to comment Share on other sites More sharing options...
ouadah2007 Posted May 26, 2020 Share Posted May 26, 2020 now i'm on windows 7 64 bit with sql server 2012 Quote Link to comment Share on other sites More sharing options...
ouadah2007 Posted May 26, 2020 Share Posted May 26, 2020 Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted May 26, 2020 Share Posted May 26, 2020 Is the database 64 bit or 32 bit? Again, you have to be careful that everything is 32 bit. Quote Link to comment Share on other sites More sharing options...
ouadah2007 Posted May 26, 2020 Share Posted May 26, 2020 I am on another system Quote Link to comment Share on other sites More sharing options...
ouadah2007 Posted May 26, 2020 Share Posted May 26, 2020 windows 7 64 bit I have a 64 bit system and I created a database on sql server 2012 Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted May 26, 2020 Share Posted May 26, 2020 Did you use the 32 bit version of SQL Server? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.