VanDyke Software Forums

VanDyke Software Forums (
-   Scripting (
-   -   how to connecting securecrt to mysql database (

WilsonGallardo 12-02-2015 10:51 AM

how to connecting securecrt to mysql database

I need to connecting a Mysql database from secureCRT, my scrip has the next lines:

Set Cnn = CreateObject("ADODB.CONNECTION")

but, the script is´t working, it´s generate a DataBase error


Wilson Gallardo

bgagnon 12-02-2015 11:21 AM

Hello Wilson,

I do not have enough information to assist at this time.

What version of SecureCRT are you using?

On what platform?

The lines provided don't seem to have anything to do with connecting via SecureCRT.

Is that the complete script?

Is the MySQL database on the same machine where SecureCRT is installed?

If not, see the Scripting / Script Objects Reference / Session Object topic in SecureCRT's Help file for information on the Connect() and ConnectInTab() methods available to SecureCRT's Session Object.

WilsonGallardo 12-02-2015 02:50 PM

hi, thanks for you answer

* I have a SecureCRT version 7.3.5 (x64 build 903)
* I need create an script to do a ping to many servers, the list ips are in a Mysql database, i need connect SecureCRT to Mysql for run the script
* Database and Segure CRT are in the same pc
* I work in windows 8 and Windows 10
* the complet scrips is the follow. (That script a copy in internet but to Access Database and modify it)

thanks for your help.

#$language = "VBScript"
#$interface = "1.0"

Const ForReading = 1
Const ForWriting = 2
Dim Rst, Cnn, sConn, sTip

Sub Main

crt.Session.Connect "/S PSM_RUN"
Set Cnn = CreateObjet("ADODB.connection")
sConn="Provider=MySQL OBDC 5.3;Data"
sel ="SELECT Cliente,ip,Sede, Tipo FROM direcciones WHERE ip<>''"
Set Rst = Cnn.Execute(sel)
Set fsoerror = CreateObject("Scripting.FileSystemObject")
set fileerror = fsoerror.CreateTextFile("E:\PLANTILLAS DB\errorlogping.txt", True)
conterror = 0

Do While Not (Rst.BOF Or Rst.EOF)
crt.Screen.Synchronous = True
crt.Screen.Send " ping -c 1 -w 1 -s 8 " & ip & chr(13)
if (crt.Screen.WaitForString(str & " is alive",3)=False) then
crt.Screen.Send Chr(3) & VbCr
fileerror.Write trim(Rst.Fields("ip").Value) & VbCrLf
conterror = conterror + 1
end if

crt.Screen.WaitForString "$",2
crt.Screen.Synchronous = False

End Sub

bgagnon 12-02-2015 04:04 PM

Hi Wilson,

Thanks for clarifying.


* the complet scrips is the follow. (That script a copy in internet but to Access Database and modify it)
I am not sure what you mean by the above statement. Please elaborate/restate.

I have no familiarity with the format of the MySQL database or how you would access the info.

What is the error message you are receiving?

If you put in some "debugging", such as a message box to check the contents of str, does it contain the expected value from the database?

Or is there any info written to the "error file"?

WilsonGallardo 12-02-2015 04:21 PM

Hi Brenda

I Mean, for Microsoft Access Data Base, the script is

Set Cnn = CreateObject("ADODB.Connection")
sConn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\mibbdd.mdb;"

but, i have a MySQL DataBase in my script that is I need.

Set Cnn = CreateObject("ADODB.connection")
sConn="Provider=MySQL ODBC 5.3 Driver; Data Source=MySQL;"

the Error Messaje is "No se encontró el proveedor especificado. Es posible que no esté instalado correctamente"


bgagnon 12-03-2015 09:16 AM

Hi Wilson,

The error message translates to (provided for the forum users that don't read Spanish):


The specified provider was not found. It may not be properly installed.
And that would seem to have *nothing* to do with SecureCRT. You will need to check with MySQL to see exactly how to reference the provider or what files are needed if files are missing. :)

WilsonGallardo 12-03-2015 04:07 PM

hi Brenda

thanks, i will check my MYSQL.


All times are GMT -6. The time now is 08:03 AM.