如何从应用程序连接到Mdf文件(Sql 2008)? [英] How Can I Connect To An Mdf File (Sql 2008) From App?
本文介绍了如何从应用程序连接到Mdf文件(Sql 2008)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以allah的名义
大家好
i使用Visual C ++ 2013,我想连接到.mdf文件(2008)。
i使用下面的驱动程序代码,但它会出错。
我的服务器地址是:8TH_SHINE
in the name of allah
hi everyone
i work with Visual C++2013 and i want to connect to an .mdf file (2008).
i use below driver code but it makes error.
my server addres is : 8TH_SHINE
Driver={SQL Server};Server=8TH_SHINE\\SQLEXPRESS;AttachDbFilename=F:\Amlak.mdf;Database=Amlak;Trusted_Connection=Yes;Uid=;Pwd=;
将.log文件放在.mdf文件的另一边。最后不起作用。
但是当我使用这个驱动程序时它可以工作:
the put the .log file too side of the .mdf file.at finally doesn't work.
but when i use this driver it works:
Driver={SQL Server};Server=8TH_SHINE\\SQLEXPRESS;Database=Amlak;Trusted_Connection=Yes;Uid=;Pwd=;
i想从中加载数据库mdf文件,而不是windows目录中的默认数据库。
你能告诉我我该怎么办?
非常感谢
i want load the databse from the mdf file, not the default database in the windows directory.
can you tell me what do i have to do?
thanks alot
推荐答案
这篇关于如何从应用程序连接到Mdf文件(Sql 2008)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文