boa tarde alguem tem alum exemplo de conexao com bando de dados mysql, que conectar sem ser por ip?, tipo banco local
to tentando com esse codigo
Dim Cn As ADODB.Connection
Dim Server_Name As String
Dim Database_Name As String
Dim User_ID As String
Dim Password As String
Dim SQLStr As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Server_Name = "F:\SysPosto\Dados\" ' Enter your server name here
Database_Name = "BDPosto.fdb" ' Enter your database name here
User_ID = "SYSDBA" ' enter your user ID here
Password = "masterkey" ' Enter your password here
Set Cn = New ADODB.Connection
Cn.Open "Driver={SQL Server};Server=" & Server_Name & ";Database=" & Database_Name & _
";Uid=" & User_ID & ";Pwd=" & Password & ";"
SQLStr = "SELECT * FROM CAIXAS" ' Enter your SQL here
rs.Open SQLStr, Cn, adOpenStatic
to tentando com esse codigo
Dim Cn As ADODB.Connection
Dim Server_Name As String
Dim Database_Name As String
Dim User_ID As String
Dim Password As String
Dim SQLStr As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Server_Name = "F:\SysPosto\Dados\" ' Enter your server name here
Database_Name = "BDPosto.fdb" ' Enter your database name here
User_ID = "SYSDBA" ' enter your user ID here
Password = "masterkey" ' Enter your password here
Set Cn = New ADODB.Connection
Cn.Open "Driver={SQL Server};Server=" & Server_Name & ";Database=" & Database_Name & _
";Uid=" & User_ID & ";Pwd=" & Password & ";"
SQLStr = "SELECT * FROM CAIXAS" ' Enter your SQL here
rs.Open SQLStr, Cn, adOpenStatic