Hag Posted October 20, 2022 Share Posted October 20, 2022 I am having difficulty connecting to a SQL SERVER database. I have created the ODBC connector in the x32 version and I am working the DAQFactory in version 5.87. The sequence to communicate with the server is as follows: global database dbase= DB.OpenEx("DSN='Advantech';UID='';PWD='';ODBC;") but when executing this sequence I get the following error: 01002 Unable to open ODBC database: database Line 3 - Uncaught error in sequence database. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted October 21, 2022 Share Posted October 21, 2022 There is no reason to use OpenEx() if you aren't using a password or specifying the driver. Just use Db.open("Advantech"). Next, make sure you have the same data source name (Advantech) and that that data source can actually get to the database. Usually the data source configuration has an option to test the connection. You'll also need to make sure you create it in the proper section. User DSN's for example are only visible to one user. Finally, 5.87 is really quite old, probably almost 15 years at this point, and as such may not work with some of the more recent ODBC drivers. I know that for MySQL you typically have to use the 3.51 ODBC driver. You might try a different driver. That all said, the most common error is to accidently create the ODBC data source in the 64 bit version of the ODBC configuration tool. 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.