Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

C++
Driver={SQL Server};Server=8TH_SHINE\\SQLEXPRESS;AttachDbFilename=F:\Amlak.mdf;Database=Amlak;Trusted_Connection=Yes;Uid=;Pwd=;


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 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
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900