DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Datebase ? (SQL)

I downloaded DB Browser for SQLite to convert .csv in .db file. So i want to call the Database with Diadem. but i don't know how to connect ADO to read this .db file.  PLZ Help 🙂


Option Explicit 'Forces the explicit declaration of all the variables in a script.
Dim ADO, RecordSet, Table, ColStr, CondStr, SortStr, ConnectionStr, QueryStr, RowVals


ConnectionStr = "Treiber ?????" & CurrentScriptPath
ConnectionStr = ConnectionStr & "Test.db"

'############################################# to fill in SQL
Table = ""
ColStr = ""
CondStr = ""
SortStr = ""
QueryStr = "SELECT" & ColStr & "From" & Table & CondStr & SortStr
MsgBox QueryStr

'#############################################

Set ADO = CreateObject ("ADODB.Connection")
ADO.Open ConnectionStr

'#############################################

Set RecordSet = ADO.Execute(QueryStr)
RowVals = RecordSet.GetRows()

'#############################################

Call Data.Root.Clear
Call Data.Root.ChannelGroups.Add(Table)
Channels = GetChanNames(ColStr)
call ArrayToChannels(RowVals, Channels, 1)

'#############################################

ADO.Close

0 Kudos
Message 1 of 3
(1,148 Views)

Hi, 

 

I understand that you have now a SQLite database to which you want to connect via DIAdem.

 

You can use the commands SQLiteOpen, SQLiteClose and SQLiteQuery to connect to it.
The commands are available starting with DIAdem version 2020. https://www.ni.com/pdf/manuals/375399h.html

 

I think this will be the easiest option, but I do not know your DIAdem version.

 

Otherwise DIAdem includes are very good example for the use of ADO elements:
https://www.ni.com/docs/en-US/bundle/diadem/page/ado/ado/ado_example.htm

Message 2 of 3
(1,120 Views)

thank you very much 😍

0 Kudos
Message 3 of 3
(1,083 Views)