no puede ser que no aya instalado el mysql.au3 ni el odcb driver
Código: Seleccionar todo
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <mysql.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("conexion", 210, 298, 380, 239)
$Input1 = GUICtrlCreateInput("", 40, 40, 129, 21)
$Input2 = GUICtrlCreateInput("", 40, 88, 129, 21)
$Input3 = GUICtrlCreateInput("", 40, 136, 129, 21)
$Input4 = GUICtrlCreateInput("", 40, 184, 129, 21)
$Label1 = GUICtrlCreateLabel("usuario", 88, 16, 38, 17)
$Label2 = GUICtrlCreateLabel("password", 80, 64, 49, 17)
$Label3 = GUICtrlCreateLabel("db world", 80, 160, 44, 17)
$Button1 = GUICtrlCreateButton("ok", 24, 232, 161, 33, $WS_GROUP)
$Label4 = GUICtrlCreateLabel("servidor", 88, 112, 41, 17)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
GUICtrlSetOnEvent($Button1, "Botton1Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func Botton1Click()
$username = GUICtrlRead($Input1)
$Password = GUICtrlRead($Input2)
$Database = GUICtrlRead($Input3)
$MySQLServerName = GUICtrlRead($Input4)
GUICtrlDelete($form1)
funconexion()
EndFunc
Func Form1Close()
exit
EndFunc
Func Form1Maximize()
EndFunc
Func Form1Minimize()
EndFunc
Func Form1Restore()
EndFunc
func funconexion()
$sql = _MySQLConnect($username, $Password, $Database, $MySQLServerName)
$opcion = InputBox("ola", "introdue el nombre de la planta")
$var = _Query($sql, "SELECT * FROM items WHERE name1 ='" & $opcion & "'")
While Not $var.EOF
msgbox(0,"resultado", "la id de la planta es " & $var.Fields("entry" ).value & ", y su clase es " & $var.Fields("clase" ).value)
$var.MoveNext
WEnd
EndFunc
Código: Seleccionar todo
# HeidiSQL Dump
#
# --------------------------------------------------------
# Host: localhost
# Database: world
# Server version: 5.0.51b-community-nt
# Server OS: Win32
# max_allowed_packet: 1048576
# HeidiSQL version: 3.0 RC3 Revision: 111
# --------------------------------------------------------
/*!40100 SET CHARACTER SET latin1;*/
#
# Database structure for database 'world'
#
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `world` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `world`;
#
# Table structure for table 'items'
#
CREATE TABLE /*!32312 IF NOT EXISTS*/ `items` (
`entry` int(255) unsigned NOT NULL default '0',
`clase` varchar(30) default '0',
`name1` varchar(255) NOT NULL default '-',
`efectos` varchar(30) NOT NULL default '0',
`obtencion` varchar(30) default '0',
`uso` varchar(30) default '0',
`cultivo` varchar(30) default '0',
`toxicidad` int(3) NOT NULL default '1',
PRIMARY KEY (`entry`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='sistema de plantas';
#
# Dumping data for table 'items'
#
/*!40000 ALTER TABLE `items` DISABLE KEYS;*/
LOCK TABLES `items` WRITE;
REPLACE INTO `items` (`entry`, `clase`, `name1`, `efectos`, `obtencion`, `uso`, `cultivo`, `toxicidad`) VALUES (1,'solanaceas','belladona','delirios','fumado','1','exterior',3),
(2,'solanaceas','extramonio','delirios','','fumado','exterior',3);
UNLOCK TABLES;
/*!40000 ALTER TABLE `items` ENABLE KEYS;*/