LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

mdb reading CVI SQL TOOL KIT

 I have Labwindow/CVI sql tool kit. But i don't know the procedure for reading a *.mdb
using that.
0 Kudos
Message 1 of 6
(4,992 Views)

Hi dsalcido,

 

You can use the following example:

 

/* This sample program simply connects to a database and then   */
/* disconnects from the database.                               */
#include "cvi_db.h"
#include <ansi_c.h>
#include <userint.h>

void ShowError()
{
    MessagePopup("Database Error",DBErrorMessage());
}

void main()
{
    int hdbc = 0;       /* Handle to database connection    */
    int resCode;        /* Result code                      */

    /* Connect to database (in this case dBase files) */
    hdbc = DBConnect ("DSN=CVI SQL Samples");
    if (hdbc <= 0) {ShowError(); goto Error;}

    /* Disconnect from database */
    resCode = DBDisconnect (hdbc);
    if (resCode != DB_SUCCESS) {ShowError(); goto Error;}
    MessagePopup ("Connect Sample",
                  "Successfully connected to and disconnected from CVI_Samples data source");
    return;
Error:
    return;
}

 

If you prefer you can browse in Help>Find Examples... clic on the Search tab and write database, there are some hepful examples.

 

Best Regards.

Arturo Gómez | Applications Engineering
Certified LabVIEW Associated Developer

National Instruments Latin America
01-800-010-0793
ni.com/support
0 Kudos
Message 2 of 6
(4,971 Views)

Hi dsalcido!

 

The best way to start is by checking out the examples installed with your toolkit. There is also an example on the web that is related to this action. The online example is:

 

http://zone.ni.com/devzone/cda/epd/p/id/3627

 

To access the examples installed with the Toolkit go to the find examples and select the Toolkits Category.

 

Hope this helps.

 

Have a great day!!

0 Kudos
Message 3 of 6
(4,970 Views)

thank you, i saw this examples and loos interesting.. but i have a problem with the OBDC driver, maybe i did a bad configuration.

 

 

0 Kudos
Message 4 of 6
(4,942 Views)

hola arturo, tengo una duda en esta parte del codigo

 

 hdbc = DBConnect ("DSN=CVI SQL Samples");

 

 para hacer la conexion con el mdb, se utiliza DBCONNECT , necesito realizar la configuracion dns en el obdc antes para indicar el path de la mdb?

 

donde peudo ver el DSN que se utilizan en los ejemplos para basarme en el? para crear el mio.

0 Kudos
Message 5 of 6
(4,937 Views)

hola dsalcido,

 

Si, antes de utilizar las herramientas de CVI, debes registrar tu base de datos ya sea como System DSN o como File DSN en Windows (Control Panel>Administrative Tools>Data Sources (ODBC)). Una vez que registres tu base de datos ya solo es cuestión de sustituir CVI SQL Samples por el nombre con el que registraste la tuya.

 

Saludos.

 

odbc.JPG

Arturo Gómez | Applications Engineering
Certified LabVIEW Associated Developer

National Instruments Latin America
01-800-010-0793
ni.com/support
0 Kudos
Message 6 of 6
(4,933 Views)