-1

I installed SQL Server 2017 Express on Windows 10. I couldn't get it to connect using adodb. I am able to connect to it from SQL Server Management Studio, I can query the tables, etc, it works fine, but not from asp.

This is from my asp classic code:

connectionString="Provider=SQLNCLI11;Server=LENOVO\SQLEXPRESS;Database=mydb;Trusted_Connection=yes;"
set cn=server.createobject("adodb.connection")
cn.open (connectionString)

I can't figure out what would be the reason. It connects when I use 'master' instead of 'mydb'. I created a new database with some new tables.

It may not be related, but I don't have a password for windows, this is my personal computer so I didn't want to have login credentials. I'm not sure if that could be the reason. I didn't try creating a user, but if that's what is the issue here I will create one.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
coder
  • 4,121
  • 14
  • 53
  • 88
  • does the user have access to `mydb` ? – Squirrel Jan 15 '18 at 03:55
  • it worked, I went into the Security\Logins -> BUILTIN\Users -> Properties -> User Mapping -> checked 'mydb' -> checked db_accessadmin and db_owner. Tried my asp code again, it worked. – coder Jan 15 '18 at 04:06

1 Answers1

0

It worked, I went into the Security\Logins -> BUILTIN\Users -> Properties -> User Mapping -> checked 'mydb' -> checked db_accessadmin and db_owner. Tried my asp code again, it worked.

coder
  • 4,121
  • 14
  • 53
  • 88
  • >>>checked db_accessadmin and db_owner<<< db_owner only is sufficient, it's already "all-inclusive" – sepupic Jan 15 '18 at 09:56