VBA-SQL Server 2014-如何访问本地主机-Windows身份验证 [英] VBA - SQL Server 2014 - How to access localhost - Windows Authentication

查看:313
本文介绍了VBA-SQL Server 2014-如何访问本地主机-Windows身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VBA-SQL Server 2014-如何访问本地主机?

几乎,我需要访问SQL Server的本地主机,并且已经尝试了在这里找到的几乎所有内容:

Pretty much, I need to access localhost of SQL Server and I have tried almost anything I found here:

通过Windows身份验证或SQL身份验证访问localhost \ SQLEXPRESS时需要使用什么sql连接字符串?

我已经尝试过了:

    str_connection_string = "Data Source=localhost\SQLEXPRESS;Initial Catalog=Tempt;Integrated Security=True;"
    str_connection_string = "Data Source = .\\\\SQLEXPRESS;Initial Catalog=Tempt;Integrated Security=True;"

并且都返回错误:

这是德语运行时错误,说了一些有关OLE DB的问题. (我的德语也不是我的前4种语言).

This is a German Run-Time error, saying something about OLE DB. (My German is also not in my top 4 languages).

我想要WindowsAuthetication.自动的,没有用户名或密码.

I want WindowsAuthetication. The automatic one, without username or password.

那有什么想法? 我使用MSSQL Management Studio 2014. ++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++

So what are the ideas? I use MSSQL Management Studio 2014. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

一天过去了.这是我早上尝试过的: @GuidoG 我喜欢这个主意,但没有成功实现.为了找到我的数据库(第3点),顶部的服务器名称(第1点)应该是什么?

A day has passed. this is what I tried in the morning: @GuidoG I liked the idea, but I did not succeed to make it in a way. What should be the servername on the top (point 1), in order to find my DB (point 3)?

@共产国际 我通过MS DB Studio连接到的本地服务器如下所示:

@Comintern The local server, to which I am connecting through the MS DB Studio looks like this:

我正在尝试连接到本地主机.

I am trying to connect to localhost.

推荐答案

实际上,这对我有用:

connectionString = "Provider=SQLNCLI11;Server=(localdb)\MSSQLLocalDB;Initial Catalog=Tempt;Trusted_Connection=yes;timeout=30;"

我的数据库名为诱惑". 我从这里获取了代码: https ://sysmod.wordpress.com/2014/07/11/adodb-connection-string-for-localdb-and-sql-server-native-client/

My db is named "Tempt". I have taken the code from here: https://sysmod.wordpress.com/2014/07/11/adodb-connection-string-for-localdb-and-sql-server-native-client/

感谢大家的帮助! :)

Thanks everyone for the help! :)

这篇关于VBA-SQL Server 2014-如何访问本地主机-Windows身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆