Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

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.

MySQL Datenbank ansprechen mit Visual Basic

Empfohlene Antworten

Veröffentlicht

Hi... ich bin sehr neu bei VB und möchte mich gleich an eine MySQL-Datenbank (w2k), die auf einem Webserver (IP:172.31.4.167) ist anbinden und habe folgenden Code geschrieben...

Dim conn As ADODB.Connection

Private Sub verbinde()

On Local Error GoTo errhandler

Set conn = New Connection

conn.ConnectionString = "Driver=={MySQL ODBC 3.51 Driver};Server=172.31.4.167;UID=all;PWD=all;database=Telefonbuch"

' Provider=MSDASQL; ;Option=16386

conn.Open

MsgBox "Funzt..."

errhandler:

MsgBox "Kaputt...", vbCritical Or vbOKOnly, "Fehler"

End Sub

... das Problem ist, dass er die Connection nicht öffnen kann, was ist denn alles falsch? Welchen Treiber und wo finde ich den?

DANKE!!

  • 2 Wochen später...

Ich hab MyODBC installiert, damit kann ich alles super ansprechen.

Ist glaub ich auch von der MySQL HP, bin mir im Moment aber nicht sicher.

Bei mir siehts dann ungefähr so aus:


Public Function DB_Öffnen() As Long

    On Error GoTo Fehler

    If gb_dbistgeöffnet Then

        DB_Öffnen = 0

        Exit Function

    End If

    With myDB

        .CursorLocation = adUseClient

        .Mode = adModeShareDenyNone

        .Provider = "MSDASQL.1"

        .ConnectionString = "Data Source=" & is_Datenbank

        .Mode = adModeReadWrite

        .Open

        gb_dbistgeöffnet = True

    End With

    Exit Function

Fehler:

    ZeigerEntladen

    DB_Öffnen = Err.Number

    mdiMain.DB_Status = Err.Number

    Err.Source = "modDatenbank\DB_Öffnen()"

    Fehler Err, "Datenbankfehler", "????"

    Err.Clear

End Function

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.