2009-10-15 70 views

Trả lời

9
Driver={SQL Native Client};server=servernamehere;database=dbnamehere;Trusted_Connection=yes; 

http://www.sqlstrings.com/SQL-Server-connection-strings.htm

http://www.connectionstrings.com/sql-server

Hãy thử điều này một:

Provider=sqloledb;Data Source=myServerName;Initial Catalog=myDatabaseName;Integrated Security=SSPI 
+1

Đã thử rồi. Không hoạt động từ VBA. – notnot

+2

Bạn đang sử dụng thành phần Truy cập dữ liệu nào? –

+0

ADODB.Connection – notnot

8

Tôi có connectionstring này trong một dự án VBA Excel 2003 ...

"Provider=SQLOLEDB;Data Source=[You DB Name];Trusted_connection=yes;" 

Và nó làm việc cho tôi! (Tôi đang sử dụng ADODB)

+0

Đây là câu trả lời hoạt động. – ikh

1

mẫu Làm việc cho VBA Excel 2010

Provider = SQLOLEDB; Data Source = ServerIPOrName; Initial Catalog = DatabaseName; Trusted_connection = yes;

Các vấn đề liên quan