Ест IB5.6 база comp1:c:\mybase.gdb
как выполнить запрос из vba
select max(fcode) from anytable
дайте пример кода, а то ниде не могу найти
Sub sample1()
Dim cn As New ADODB.Connection
'use connection string from file "employee.ibp":
'data source=localhost:d:\database\employee.gdb;User ID=gamer;password=vermut;
'ctype=win1251;auto_commit=true;
cn.Open "file name=d:\database\employee.ibp"
cn.Close
'Standart connection methods
cn.Provider = "LCPI.IBProvider"
' Using user
cn.Open "data source=localhost:d:\database\employee.gdb;ctype=win1251;" & _
"user=gamer;password=vermut"
Dim cmd As New ADODB.Command
Dim rs As ADODB.Recordset
cmd.ActiveConnection = cn
cmd.CommandText = "select * from employee order by emp_no"
'Creation of recordset with the unidirectional access
Set rs = cmd.Execute
While Not rs.EOF
Debug.Print RowToStr(rs)
rs.MoveNext
Wend
Debug.Print "+++++++++++++++++++++++++++"
rs.Close
cn.Close
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 60