12-14-2005 02:02 PM
12-18-2005 10:51 PM
12-19-2005 09:06 AM
12-20-2005 12:34 PM
Hi cowbreath,
Here's a function I have created which seems to return the connectability of a database without those annoying error dialogs.
'MsgBox DBok("Thales_DSN", "sa", "wermut")
MsgBox DBok("Thales_DSN", "sa", "")
'-------------------------------------------------------------------------------------
'******* DBok() *** *** NEW Function ***
'-------------------------------------------------------------------------------------
Function DBok(DSN, User, Password)
DBok = FALSE
Dim ADO, ADOstr, ErrNum
IF DSN = "" THEN Exit Function
ADOstr = "DSN=" & DSN & ";"
ADOstr = ADOstr & "UID=" & User & ";"
ADOstr = ADOstr & "PWD=" & Password
On Error Resume Next
Set ADO = CreateObject("ADODB.Connection")
Call ADO.Open(ADOstr)
ErrNum = Err.Number
On Error Goto 0
IF ErrNum <> 0 THEN Exit Function
DBok = TRUE
End Function ' DBok()
Let me know how it works for you,
Brad Turpin
DIadem Product Support Engineer
National Instruments
01-30-2006 10:04 AM
08-21-2013 07:55 AM
can you tell me how to put your code in diadem and replace the areas with mySQL connection?
08-28-2013 06:11 PM
Hi labsergio,
Do you have an ODBC data base driver for your MySQL data base, or is it an OLE data base driver? Is there any other program that already talks to this data base? Is there an IT person who can tell you what the "ADO connection string" to this data base is?
Brad Turpin
DIAdem Product Support Engineer
National Instruments