У меня следующий код VBA, и я получаю сообщение об ошибке, указанное в заголовке этого вопроса. Кто-нибудь может помочь? Я обычно не пишу такой код:
Sub Save_To_DB()
'Declare some variables
Dim cnn As ADODB.Connection
Dim cmd As ADODB.Command
Dim strSQL As String
'Create a new Connection object
Set cnn = New ADODB.Connection
'Set the connection string
cnn.ConnectionString = "Server=server_name;Database=database_name;Trusted_Connection=True;"
'Open the Connection to the database
cnn.Open **<-THE ERROR THROWS HERE**
'Create a new Command object
Set cmd = New ADODB.Command
'Associate the command with the connection
cmd.ActiveConnection = cnn
'Go on to write the SQL statement and execute
РЕДАКТИРОВАТЬ: ОК, я решил, нужно включить Driver={SQL Native Client};
в строке подключения.