Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

base de datos en remoteMySql.com

publicado

Hola como están?

Estoy probando un servicio gratuito que ofrece la página https://remotemysql.com/

La misma ofrece 3 bases de datos de hasta 100 mb de mysql para acceder de forma remota y se la puede configurar en PHP.
Ya cree una base de datos y conseguí acceder a la misma a través de VBA de Excel. 

El problema: Al realizar la consulta a través del formulario. La misma tarda casi 4 segundos. Y mi idea es poder realizar las búsquedas de los registros a través del formulario de excel, pero necesitaria reducir el tiempo que se tarda en realizar la conexión. Esto es posible?
Desde ya muchas gracias y un abrazo. Adjunto a continuación el código y el archivo 

Private Const DRIVER_MYSQL   As String = "DRIVER={MySQL ODBC 8.0 ANSI Driver};"
Private Const OPCIONS_MYSQL  As String = "SERVER=remotemysql.com;PORT=3306;DATABASE=yat7DgcNyh" & _
 ";USER=yat7DgcNyh;PASSWORD=msTPsBzj0J;"
Public connMySql As ADODB.Connection
 Dim rsMySql As ADODB.Recordset
 Dim com As New ADODB.Command


'Donde "BBDatos" es el nombre de la base de datos y "Clave", la contraseña para ingresar a Mysql.

'Con la siguiente instrucción abrimos la conexión
Sub ConexionMysql()
    Set connMySql = New ADODB.Connection
    connMySql.Open DRIVER_MYSQL & OPCIONS_MYSQL
           
End Sub

'Y con esta otra instrucción cerramos la conexión, después de realizar lo que necesitamos hacer, ya sea insertando, eliminanado o consultando registros en nuestra base de datos Mysql.
Sub CierraConexion()
    'cerramos la conexión
    connMySql.Close
End Sub

Private Sub CommandButton1_Click()
ConexionMysql

Sql = "SELECT CI,DESCRIPCION,MARCA,PRECIO from Personas"

Dim com As New ADODB.Command
com.ActiveConnection = connMySql
com.CommandText = Sql
com.CommandType = adCmdText

Set rsMySql = com.Execute
If rsMySql.EOF = True Then
MsgBox "No se encontraro registros"
Exit Sub
End If

Me.ListBox1.ColumnCount = 4
Me.ListBox1.ColumnWidths = "20PT;50PT;20PT;20PT"
Me.ListBox1.Column = rsMySql.GetRows

connMySql.Close
End Sub

mysql.xlsm

Featured Replies

publicado

Interesante, estoy haciendo pruebas y funciona.

La base de datos la estoy gestionando de MySQL workbench.

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.