|
#1
|
|||
|
|||
how to connecting securecrt to mysql database
hi
I need to connecting a Mysql database from secureCRT, my scrip has the next lines: Set Cnn = CreateObject("ADODB.CONNECTION") SConn="provider=MySQL.OBDC.5.3;data" Source=MySQL Cnn.open(sConn) but, the script is´t working, it´s generate a DataBase error regards Wilson Gallardo |
#2
|
|||
|
|||
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.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
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" Source=MySQL Cnn.Open(sConn) 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) Rst.MoveFirst conterror = 0 Do While Not (Rst.BOF Or Rst.EOF) str=trim(Rst.Fields("ip").Value) 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 Rst.MoveNext Loop Rst.Close Cnn.Close End Sub |
#4
|
|||
|
|||
Hi Wilson,
Thanks for clarifying. Quote:
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"?
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#5
|
|||
|
|||
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;" Cnn.Open(sConn) 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;" Cnn.Open(sConn) the Error Messaje is "No se encontró el proveedor especificado. Es posible que no esté instalado correctamente" thanks |
#6
|
|||
|
|||
Hi Wilson,
The error message translates to (provided for the forum users that don't read Spanish): Quote:
![]()
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
![]() |
Tags |
connect , database , error , mysql , script |
Thread Tools | |
Display Modes | Rate This Thread |
|
|