Path to database - SQL Toolkit

Hi !
I succesfully use SQL to maintain a database. Now I'd like to get the directory
name where that database is located as a character string. Again: opening
the database there's no problem after DBConnect( "DSN=SOFTPROD" ) but now
I'd like to get the directory where DBConnect found the database (it uses
the ODBC settings I suppose). Does anybody know ?

I think you have to search in the MSDN to use directly the ODBC functions.
The SQLtoolkits functions such DBTables(), DBDatabase() can't do such a thing.
The ODBC functions allows you to create a DSN, and ....
"Han Stehmann" wrote:
>>Hi !>>I succesfully use SQL to maintain a database. Now I'd like to get
the directory>name where that database is located as a character string.
Again: opening>the database there's no problem after DBConnect( "DSN=SOFTPROD"
) but now>I'd like to get the directory where DBConnect found the database
(it uses>the ODBC settings I suppose). Does anybody know ?

Similar Messages

  • MySQL database with SQL Toolkit

    Hi,
    we are using CVI 2012 and the SQL Toolkit 2.2 and we want to connect to a MySQL database.
    The MySQL database was created with MySQLServer. When we try to connect with DBConnect we get an error.
    How can we connect the MySQL Database?
    What do we have to type in the connection string in DBConnect? Is it the name of the database, the path to the database or anything else?
    Does any one have experience with the SQL toolkit?
    Thanks in advance
    Oliver
    Solved!
    Go to Solution.

    You need to install the mysql connector odbc and then create an ODBC dns for your database.
    control panel, administrative, odbc

  • Why do I get a class conflict between the Prepare SQL.vi and the Get Column Name.vi with the SQL Toolkit compatibility vis from the Database Connectivity Toolkit?

    I have done extensive programming with the SQL Toolkit with LabVIEW versions through 6.1. My customer now wants to upgrade to Windows 7, so I am trying to upgrade to LabVIEW 2009 (my latest purchased version) using the Database Connectivity Toolkit, and the SQL Toolkit Compatibility vis. Everything seemed to be going okay with the higher level SQL operations, but I ran into trouble with the Get Column Name.vi. 
    The pictures below show the problem. The original SQL Toolkit connected the Prepare SQL.vi with the Get Column Name.vi with a cluster of two references, one for connection, and one for sql. The new compatibility vis have a class conflict in the wire because the Prepare SQL.vi contains a cluster with connection, and command references, but the Get Column Name.vi expects a cluster with connection and recordset references. 
    How do I resolve this conflict?
    Thank You.
    Dan

    I've never worked with the old version of the toolkit, so I don't know how it did things, but looking inside the SQL prep VI, it only generates a command, and the the column name VI wants a recordset. I'm not super familiar with all the internals of ADO, but my understanding is that is standard - you only have the columns after you execute the command and get the recordset back. What you can apparently do here is insert the Execute Prepared SQL VI in the middle and that will return what you need.
    I'm not sure why it worked before. Maybe the execute was hidden inside the prep VI or maybe you can get the column names out of the command object before execution. In general, I would recommend considering switching to the newer VIs.
    Try to take over the world!

  • How can I use SQL TOOLKIT concurrently with Database Connectivity ?

    I have installed LabVIEW 6.1 with the Database Connectivity Toolkit and the SQL Compatibility Toolkit (e.g. _SQL folder). I am trying to make the transition from the SQL Toolkit VIs to the Database Connectivity toolkits, but for compatability with existing systems I would like to be able to run the two sets of VIs concurrently (but not in the same app).
    When I read into 6.1 a connection VI that I wrote with LabVIEW 6.0 and the SQL toolkit the connection reference type gets changed from a number to type connection (see attachments) . Does compatbility mean that my SQL toolkit VIs are converted to a form compatible with the new ADO ?
    Can I use the SQL Toolkit VIs or the Database connectivit
    y VIs in the same installation of 6.1 ?
    Can I have the SQL Toolkit VIs appear on the functions pallette and function as they did when only the SQL toolkit was installed ?
    Attachments:
    CNNCT.vi ‏20 KB
    CNNCT.vi ‏22 KB

    In response to your #2 below:
    Actually it is possible to have the old SQL Toolkit and new Database
    connectivity in the same installation of LabVIEW. I have only tried it on
    6i, but don't see why it wouldn't work on 6.1. The trick is not to install
    the SQL toolkit compatabitily VI's. The old SQL toolkit uses the Intersolve
    dll through ODBC while the new Database connectivity uses ADO so it is
    possible to use both methods not only in the same LabVIEW install, but it
    the same running application. It has been a while since I originally did
    this, so I am posting only to mention that it is possible and not exactly
    how to do it. If anyone is interested in more details just respond.
    Brian
    "Jeff B" wrote in message
    news:[email protected]...
    > First, direct answers to your direct questions:
    >
    > 1. Does compatbility mean that my SQL toolkit VIs are converted to a
    > form compatible with the new ADO ?
    >
    > Yes
    >
    > 2. Can I use the SQL Toolkit VIs or the Database connectivity VIs in
    > the same installation of 6.1 ?
    >
    > No
    >
    > 3. Can I have the SQL Toolkit VIs appear on the functions pallette
    > and function as they did when only the SQL toolkit was installed ?
    >
    > No
    >
    >
    > Now an elaboration:
    >
    > Having the old SQL Toolkit and the new Database Connectivity Toolset
    > installed on the same version of LabVIEW on the same computer is not
    > supported.
    >
    > Once you install the Database Connectivity Toolset, any VIs written
    > with the SQL Toolkit will run, but with the ADO layer, as you
    > suspected.
    >
    > Internally, the only way we can have both the SQL Toolkit and the
    > Database Connectivity Toolset installed on the same computer for
    > troubleshooting customer issues is to have them installed on different
    > versions of LabVIEW. I, for example, have LabVIEW 5.1.2, 6.0.3, and
    > 6.1 all installed on my computer, and I have the SQL Toolkit install
    > on LabVIEW 5.1.2, and the Database Connectivity Toolset installed on
    > LabVIEW 6.0.3. In this configuration I can still run SQL Toolkit VIs
    > independent of the Database Connectivity Toolset if I open and run
    > them in LabVIEW 5.1.2.

  • I want to use the SQL Toolkit of NI and SQL Server as my databasis on a server. Do I need to install a client in each computer I want to handle the data into SQL tables or I need only a ODBC driver?

    I want to use the SQL Toolkit of NI and SQL Server as my databasis on a server. Do I need to install a client in each computer I want to handle the data into SQL tables or I need only a ODBC driver?

    You only need the ODBC driver on each computer. If you are distributing the SQL Toolkit app as an executable and do not install the whole toolkit on each computer, you'll need the SQL Toolkit support files. This is about a dozen files. You can get the list at http://digital.ni.com/public.nsf/websearch/b814be005f9da9258625658700550c75?OpenDocument.

  • How to compact and repair a MS Access database with NI CVI 8.5 (and SQL Toolkit)

    Hello
    I'm using the SQL Toolkit with CVI 8.5 for accessing MS Access Databases.
    Is there a possibility to compact and repair the .mdb file with  CVI?
    Thanks in advance.

    Hello Ulrich,
    with compact and repair I mean the MSAccess function "Compact and Repair".
    Please follow the link below for more details:
    http://office.microsoft.com/en-us/access-help/compact-and-repair-an-access-file-HP005187449.aspx
    Normally you can execute this function directly in Access or with the Windows ODBC Data Sources Administrator  => "Control Panel" => "Administrative Tools" => "Data Sources (ODBC)"...
     I want to execute this function via cvi code and not by hand ;-).
    Thank you for your support.
    Frank

  • Mysql database connection with Labwindows/CVI 2009 sql toolkit

    Dear experienced users,
    I am using the following software/hardware:
    Windows 7/ Mysql database 5.6.15 64-bit with MySql ODBC 5.2 Ansi driver installed
    Labwindows/CVI 2009 with sql toolkit
    The user DSN of ODBC Data source administrator have been confiugred to one of mysql database. The test MYSQL Connector/ODBC is succesful.
    The Labwindows/CVI build setting is configure to debug64 after trying debug (32)
    The source code is from the example readtab.c with changes to the dsn I am testing
        hdbc = DBConnect ("DSN=dvd_collection");   
    The error message I have is confusing me.
    (it is in the attachd png)
    I thought it was due to the 64 bit mysql database. That's why I tried the 64 bit build from Labwiondws/CVI. I alsow tried Labview DB tools open connect.vi. It shows me the same error.
    Any suggestion is appreciated.
    Thanks,
    Jimmy
    Attachments:
    Capture.PNG ‏24 KB

    Jimmy
    I always use connection strings of the form "DSN=datasourcename;UID=database_user_id; PWD=database_user_password".
    Where:
    datasourcename = The name of the connection defined in the ODBC connection.
    database_user_id = One of the user identities created by the database administrator. Obviously the administrator will lock down the permissions appropriate to the task in hand.
    database_user_password = The password that identifies database_user_id, again set by the database administrator.
    Note that while it is obviously desireable to lock the permissions down as far as possible on the MySQL server, the more you do so, the slower the database will run, because of the way mySQL searches the permissions tables.

  • What is the equivalent Database Connectivity VI of the SQL Toolkit 'Set SQL Parameter to Null' VI ?

    I am using the database connectivity (ADO based) tool and I want to be able to insert a null values.
    I have included a simple VI that demonstrates how this works with SQL toolkit .
    Null values are very useful and occur frequently in dealing with data. I wish that LabVIEW handled them much better - (e.g. there is not datatype in LabVIEW corresponding to a Null value).

    The VI was not attached but I'm going to answer with what I have here.
    - Currently, the Database Toolset converts NULLs to the default value for LabVIEW data types (ie, False for Boolean, empty strings, zero for numbers, empty arrays, etc). In the user manual there is an example that shows database records containing NULL values being first converted to a string, empty strings (the NULLs) are then converted to NaNs instead of the usual zero value. This method requires you to know what data types each field contains and that they know what to look for and how to convert the data.
    You can go to this following link to suggest that a null datatype be implemented:
    https://sine.ni.com/apps/we/nicc.call_me?p_country=&p_lang_id=US&p_form_id=58
    -Also you cannot leave par
    ameters values empty because there is a big difference between executing an SQL statement and doing a Parameterized Query, especially when looking at the low-level ADO layer.When doing Parameterized Queries, you MUST specify all parameter values - leaving them empty results in ADO trapping errors rather than using a default value.
    Regards,
    Cyril Bouton
    Applications Engineer
    National Instruments
    Cyril Bouton
    Active LabVIEW Developper

  • Help, Cannot connect to ODBC database using SQL Toolkit!

    Hello All,
    I am toying around with the SQL Toolkit evaluation (2.2 + the patch) and I am having difficulty.
    I ran the example program "connect" and it seems to work fine.
    However, I try to write my own program and I keep getting the same message:
    "Function DBConnect: (return value == -10 [0xFFFFFFF6]).
    Native error code - 2147467259 0x80004005
    The message differs from time to time, but the return value is constant.
    I am using both Microsoft SQL Server 2012 and MySQL.
    For MySQL I have installed the latest ODBC connector, 5.3.4. Inside the Control Panel/Data Sources(ODBC), I have a DSN named test_mysql in both User DSN and System DSN.
    I ran a test on the connection and the test passes. I am not sure if I should use the ansi or unicode driver, I have tried both with the same success.
    I am not sure I had configured the SQL Server connection properly, and will attempt that again.
    My CVI Code is simple enough:
    hdbc = DBConnect ("DSN=test_mysql"); 
    Every time I get a -10 from DBConnect. Either I have something configured wrong or I am missing something.
    Does anyone have any suggestions?
    Veni Vidi Duci
    Solved!
    Go to Solution.

    Update 2:
    After getting off the phone with Tech Support the problem has been identified!
    LabWindows SQL toolkit requires 32 bit DNS. My PC is a 64 bit, so my DNS manager defaulted to 64 bit.
    I needed to use the 32 bit DNS manager when working with the toolkit.
    Once I created my DNS connections using the 32-bit version of the ODBC Datga Source manager, everything worked fine.
    See this tech note:
    http://digital.ni.com/public.nsf/allkb/E7984C0DA0F0E65086257694005B4CB7
    Veni Vidi Duci

  • I am using the database connectivity toolkit to retrieve data using a SQL query. The database has 1 million records, I am retrieving 4000 records from the database and the results are taking too long to get, is there any way of speeding it up?

    I am using the "fetch all" vi to do this, but it is retrieving one record at a time, (if you examine the block diagram) How can i retrieve all records in a faster more efficient manner?

    If this isn't faster than your previous method, then I think you found the wrong example. If you have the Database Connectivity Toolkit installed, then go to the LabVIEW Help menu and select "Find Examples". It defaults to searching for tasks, so open the "Communicating with External Applications" and "Databases" and open the Read All Data. The List Column names just gives the correct header to the resulting table and is a fast operation. That's not what you are supposed to be looking at ... it's the DBTools Select All Data subVI that is the important one. If you open it and look at its diagram, you'll see that it uses a completely different set of ADO methods and properties to retrieve all the data.

  • Path for database

    Hi,
    I have an old program, written in LabVIEW 5.1 that uses databases. The database in located in the harddrive on the computer. Now, I would like to move the database to the network. Where do I change the directory path for the database?? I ahve tried to configure the ODBC Data Source Administartor, but I can't seem to get it work. (I have done some changes that onlyu made it worse, by now I can't access the database at all.)
    Anyone having any ideas?
    Thank you, Regards
    FRida

    Crystal wrote:
    I think the problem
    Frida is running into is that the Database Connectivity Toolkit wasn't
    around for 5.1 (it released with 6.0).  So the only thing we had
    back then was the SQL Toolkit.  It used third party ODBC drivers
    from DataDirect (they've changed names at least two times since LV
    5.1).  UDL files are not an option because that old toolkit used a
    CIN to communicate directly to that one specific ODBC driver. 
    Since I've not used that toolkit nor those drivers for over 5
    years, I'm not entirely sure you can change the location of the file in
    the ODBC Administrator.  I'm also not sure that updating the
    DataDirect drivers would help because I don't think that old toolkit
    has been tested with any new drivers.  I'm going to have to defer
    to others on this list who might be using the old SQL Toolkit and LV
    5.1.
    The SQL Toolkit Connect
    function has if I remember correctly a string input for connection
    parameters. It is this connection parameters string that can be used to
    pass additional parameters to the ODBC manager. The ODBC manager will
    retrieve possible information intended for its own use, such as the DSN
    or Driver keyword that can be used to define the Data Source Name or
    directly a Driver that should be opened and passes the rest to the
    driver itself for further investigation. This is for instance used for
    PWD and UID for password and user login to the driver. Other parameters
    are obviously driver dependant but MS Access for instance supports (and
    in the case of a direct driver specification to the ODBC manager
    requires) a DBQ parameter in the form of DBQ="<path to your database
    file>".
    I'm pretty sure ADO's Connection.Open method supports the same or
    similar additional connection parameters in its connection string.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • DBPutRecord Error in SQL Toolkit 2.0 for Mysql

    Dear All
    I am using Labwindows/CVI 7.1.1 with SQL Toolkit 2.0. I have facing problem in DBPutRecord in database.
    First I mapped the Table. While putting Records in table I am facing native Error Code 2147467259.
    I can Get the Datas from Table using bound funtion
    But Same function and method working fine in CVI 5.5.
    Please some one give me the Solution.

    kindly refer this and this knowledgebase
    Shreyas Hebbare
    Shreyas Technologies
    India

  • Set password for DSN (SQL Toolkit)

    Hello everybody,
    I'm working on WinNT4.0 with LV5.1.1 and SQL Toolkit v5.0. I've got an ODBC
    DSN for an Oracle7 database. I'm asked for a password when I make a connection
    to the DSN, which I now enter manually.
    After that I can read and write data to the database.
    Does anybody know how I can set the password automatically with the SQL Toolkit
    to avoid the dialog ?
    Otherwise there always has to be a user present when a connection to the
    database is made, which would be very unkomfortable.
    Is there any solution ?
    Many thanks in advance.
    Ralf.

    Wire a string constant to the SQL Connect VI's Connection Parameters input
    and include the appropriate connection parameters. For MS SQL7 the info
    looks like this:
    UID=username;PWD=password
    I don't use Oracle, but I imagine it would be similar. If your unsure, create
    a file DSN using the ODBC administrator in NT and mimic the parameters it
    creates.
    "Ralf Erdmann" wrote:
    >>Hello everybody,>I'm working on WinNT4.0 with LV5.1.1 and SQL Toolkit v5.0.
    I've got an ODBC>DSN for an Oracle7 database. I'm asked for a password when
    I make a connection>to the DSN, which I now enter manually.>After that I
    can read and write data to the database.>Does anybody know how I can set
    the password automatically with the SQL Toolkit>to avoid the dialog ?>
    Otherwise
    there always has to be a user present when a connection to the>database is
    made, which would be very unkomfortable.>Is there any solution ?>>Many thanks
    in advance.>Ralf.>

  • LabWindows CVI and SQL Toolkit cursor/sch​ema error

    We are using CVI 8.5 and SQL Toolkit 2.0.6 to write data to a SQL Server 2008 database.  We are utilizing the Microsoft ODBC SQL Server (non-native) driver.  We build a transaction that calls stored procedures on the database to write the data.  Occasionally we get the following error:
    "Could not complete cursor operation because the table schema changed after the cursor was declared"
    The error is unusual since we only use one cursor and it is in a stored procedure that gets called by other software hundreds of times a day and never fails.  Our database is also designed to only append records, not change existing ones.  We're trying to pinpoint the error and I'm wondering if anyone knows if the SQL Toolkit uses cursors to build transactions or if this error has been seen by others.  Since upgrading the toolkit or drivers takes a lot of effort, I want to make sure that I understand the problem before I start throwing darts at it.  Thanks in advance for any insight.

    I've attached the function that's failing.  Unfortunately, the code isn't designed with much resolution as to what SQL toolkit call failed, since these calls haven't failed once validated and put into the production environment.  Can you tell if any of these functions use a cursor.  I could certainly try adding more resolution to the error handling, but since we've only seen errors occasionally in the production environment, I'd need to release a temp version and monitor it.  Let me know what you think.  Thanks.
    Attachments:
    StoreTestData.txt ‏5 KB

  • SQL toolkit 2.2 Stored Procedure Memory Leaks

    Hi
    we are using CVI 2012 and SQL Toolkit 2.2. My db is "MySql 5.5.28" and I use "MySQL Connector/ODBC 5.2(w)"
    I use only stored procedure (with and without the output parameters).  If I call continuously a stored procedure,
    with Sql toolkit code, I have memory leaks!! 
    My code (without error handler) is:
    // iDbConnId is the handle of DBConnect() called when program starts
    iStmt = DBPrepareSQL(iDbConnId, "spGetPrData");
    DBSetStatementAttribute(iStmt, ATTR_DB_STMT_COMMAND_TYPE, DB_COMMAND_STORED_PROC);
    DBExecutePreparedSQL(iStmt);
    DBBindColLongLong(iStmt, 1, &llPrId, &lStatus1);
    DBBindColInt(iStmt, 2, &iIpPort, &lStatus2);
    while(DBFetchNext(iStmt) != DB_EOF)
        //get data
    DBClosePreparedSQL(iStmt);
    DBDiscardSQLStatement(iStmt);
    If I call the same stored procedure by sql code ("CALL spProcedure()")
    I don't have memory leaks!!
    The code is (without error handler):
    // iDbConnId is the handle of DBConnect() called when program starts
    iStmt = DBActivateSQL(iDbConnId, "CALL spGetPrData();");
    DBBindColLongLong(iStmt, 1, &llPrId, &lStatus1);
    DBBindColInt(iStmt, 2, &iIpPort, &lStatus2);
    while(DBFetchNext(iStmt) != DB_EOF)
        //get data
    DBDeactivateSQL (iStmt)
    It seems to me that the DBDeactivateSQL function free the memory correctly,
    while the functions DBClosePreparedSQL and DBDiscardSQLStatement do not release properly the memory,
    (or I use improperly the library functions!!!)
    I also have a question to ask:
    Can I open and close the connection every time I connect to the database or is it mandatory to open and close it just one time?
    How can I check the status of the database connection, if is mandatory to open and close the db connection just one time?
    Thanks for your help.
    Best Regards
    Patrizio

    Hi,
    one of the functions "DBClosePreparedSQL and DBDiscardSQLStatement" is a known problem. In fact, there is a CAR (Corrective Action Request 91490) reporting the problem. What version of the toolkit are you using?
    About this function you refer to the manual:
    http://digital.ni.com/manuals.nsf/websearch/D3DF4019471D3A9386256B3C006CDC78
    Where functions are described. To avoid memory leaks DBDeactivateSQL must be used. DBDeactivateSQL is equivalent to calling DBCloseSQLStatement, then DBDiscardSQLStatement. DBDeativateSQL will work at all for parameterized SQL, as well.
    Regarding the connection mode advice to you is to open the connection once and close it at the end of your operations. What do you mean with "state of the database connection"? Remember that if you have connection problems or something goes wrong, the errors appears in any point in your code where you query the database. Bye
    Mario

Maybe you are looking for

  • ITunes Crashes EVERY TIME I go to iTunes Store, S'up wit dat?

    Headline sez it all: I get the following message: KERNPROTECTIONFAILURE - Whenever I go to the iTunes Store, iTunes will crash completely. Frustrating. What's up? I am on a G4 CPU @ 1.5 megahertz. 10.4.8 with QT 7.1. Can figure it out - gotta get me

  • Certain image not showing in email

    This issue happened using Firefox 14.0.1 in Windows7 I have an email that loads several images from a specific website. All the images load except the company's logo. At first I thought it might be yahoo mail issue. However I tried opening same email

  • Pausing Flash movie on focus lost

    Is there any way thru ActionScript to detect the loss of focus at the Flash movie level, eg. browser minimize or selection of another window, I would like to auto-pause my game at this point. I managed to create a reasonably effective solution using

  • Best practise - Domain model design

    Hello forum, we're writing an application divided into three sub projects where one of the sub projects will be realized using J2EE and the other two sub projects are stand alone fat client applications realized using Swing. So that's the background.

  • HELP WITH ELEMENTS 12 AND CAMERA RAW

    Hi!!! I have just downloaded elements 12 under trial. I was trying to open a sample image in cr2 format from my 70D - but it says that my camera raw is out of date. How do i update it? I tried the obvious but couldnt find any links to an upgrade. Tha