0

hi all i have 2 systems connected in lan.i have to access the system 1 Database from system2 using mysql odbc connector.if i give localhost in the hostname then give username and password of system2 in the corressponding places now i can get the list of databases from system2 mysql databases.the problem was i tried in the odbc connector by giving the datasource name and in the place of host name i have given system 1 ip address then in the place of user and password i have given the system1 mysql username and password but i did not get the list of databases in the place of database name.so guide me to get

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by StephNicolaou
0

The username and password on the connection has to be the username and password of the database. Post the code you have... And if all else fails the DAO method is a lot easier.

Dim rs As DAO.Recordset
    Dim db As DAO.Database
    Set db = CurrentDb
    Dim path As String
    
    '--------------------------------------------------------
    'BACKEND DATABASE PATH
    path = "C:\path\DB.mdb"
    '-----------------------------------------------------------
    
    'Open all tables
    Set rs = CurrentDb.OpenRecordset("SELECT Name " & _
                                    "FROM MSysObjects IN '" & path & "' " & _
                                    "WHERE Type=1 AND Flags=0")

    'Retrieve data from a table
    Me.RecordSource = "SELECT * FROM [TBL] IN '" & path & "'"
    Me.Requery

Edited by StephNicolaou: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.