LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a DSN(Data Source Name) in ODBC? How?

Hello,
 
How does one create DSN (Data Source Name) in ODBC control panel?
 
I was thinking of doing it through the UDL because I saw ODBC there but that is not it.  I don't think the UDL and DSN are similar.
 
Anyway,  through the 7.1 application how can I do what my title says?
 
I could not find the ODBC in the Windows Control panel of my LV.
 
Thanks for any help.
0 Kudos
Message 1 of 16
(4,574 Views)
This is done using the ODBC Administrator (odbcad32.exe) which is available from the Windows control panel.  Browse to: Start >> Settings >> Control Panel >> Administrative Tools >> Data Sources (ODBC).  From this dialog you can register a DSN.
Message 2 of 16
(4,565 Views)

Thank you very much.  I saw your website and I am impressed. 

Personally I am not at your level yet .

I have another question: why won't this VI work.  I have done what it says to do, but it will not import data as results.

0 Kudos
Message 3 of 16
(4,564 Views)
In case the above example doesn't work, I've saved the code onto Word.
 
Thanks for any help.
0 Kudos
Message 4 of 16
(4,558 Views)
For the connection string, just enter the actual data source name that you created. If the data source name is "myDB", then that's all that you use. I think the LabSQL shipping example was in error. The ADO Connection Open will create the string DSN=myDB which is what the ADO Connection.Open property requires. There is something else missing in the LabSQL example that might give you problems. Some databases (i.e. SQLServer) require that you provide a user ID and password. The ADO Connection Open VI has inputs for these but there are no controls in the top level example. Create them if you need to.
Message 5 of 16
(4,554 Views)


@Dennis Knutson wrote:
For the connection string, just enter the actual data source name that you created. If the data source name is "myDB", then that's all that you use. I think the LabSQL shipping example was in error. The ADO Connection Open will create the string DSN=myDB which is what the ADO Connection.Open property requires. There is something else missing in the LabSQL example that might give you problems. Some databases (i.e. SQLServer) require that you provide a user ID and password. The ADO Connection Open VI has inputs for these but there are no controls in the top level example. Create them if you need to.



Either of the connection strings "DSN=myDB" or "myDB" work for me.  Maybe there is a difference between ADO versions in terms of autorecognizing the connection string format and parsing out the needed information.
0 Kudos
Message 6 of 16
(4,545 Views)


@roboticstudent wrote:

Thank you very much.  I saw your website and I am impressed. 

Personally I am not at your level yet .

I have another question: why won't this VI work.  I have done what it says to do, but it will not import data as results.




Thank you.  Try Dennis's idea of changing your connection string to just "
myDB" and see if that works.  The only other thing that I can think of is that maybe your DSN is not registered correctly.  Good luck.
Message 7 of 16
(4,543 Views)
Hello,
 
Thanks for your help.
 
I tried what you suggested with the connection string, but it still does not work.
 
I am trying something similar to LabSQL, but with Access.  I am trying to make it my own.
 
Anyway, can anyone suggest what I can do with this VI that creates and drops VI using Access.
 
Individually, they were fine, but when combined it does not work together. 
 
Does anyone know how I can fix this?
 
Also, I wanted to show in the front panel all the existing tables so that when one was dropped the user would notice instead of always having to go into Access to check.
 
Thanks for any help.
 
0 Kudos
Message 8 of 16
(4,539 Views)

Hi Robot,

Your Vi works fine as long as you connect a valid "table" parameter to the "DB Tools Drop Table.vi". I ran your example fine by connecting "table" to the "Physical_Coordinates" string constant. By singlestepping through the VI I could follow the creation and deletion of the "Physical_Coordinates" table in my Access database.

To see a collection of the existing tables of your database, use the "DB Tools List Tables.vi". That way you don't have to keep Access open to verify the creation and deletion of the tables.

I hope this answers your questions, otherwise please let me know, thanks.

Have Fun!

Message Edited by Philip C. on 09-19-2005 11:16 PM

- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Message 9 of 16
(4,497 Views)

Hello,

Thanks Philip C. Your ideas are very helpful.

I am having problems implementing them so that they work.

How did you get a connection between "table" to the "Physical_Coordinates" string constant? The wiring showed error when I did this.

Also, why does the "DB Tools List Tables.vi" not reflect the creation and deletion of the table?

I have a VI attached to show how I connected the "DB ToolsList Tables.vi" but the the Front Panel does not show the collection of the existing tables in my Access database.

Thanks again for your assistance.

0 Kudos
Message 10 of 16
(4,474 Views)