Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-12-20 : 09:19:23
|
| Jerome writes "How do I connect VB with Sql server without using username andpassword and also without using Windows NT Authentication." |
|
|
royv
Constraint Violating Yak Guru
455 Posts |
Posted - 2001-12-20 : 09:25:03
|
| You can configure a DSN entry one-time to point to the correct server, and then in your VB code, all you have to do is specify the provider and the dsn name and you are set.*************************Just trying to get things done |
 |
|
|
KnooKie
Aged Yak Warrior
623 Posts |
Posted - 2001-12-20 : 10:37:47
|
| The potential problem with this is that you may have to hard code a username and pswd in the connection string. If this isn't a problem then why not create a class module similar to this.....Private cnn1 As ConnectionPrivate msDSN As StringPrivate msUserID As StringPrivate msPassword As StringPublic Property Let DSN(thisDSN As String) msDSN = thisDSNEnd PropertyPublic Property Get DSN() As String DSN = msDSNEnd PropertyPublic Property Let UserID(thisUserID As String) msUserID = thisUserIDEnd PropertyPublic Property Get UserID() As String UserID = msUserIDEnd PropertyPublic Property Let Password(thisPassword As String) msPassword = thisPasswordEnd PropertyPublic Property Get Password() As String Password = msPasswordEnd PropertyPublic Sub connect()Set cnn1 = New Connectioncnn1.ConnectionString = "Data Source=" & msDSN & ";user ID=" & msUserID & ";password=" & msPasswordcnn1.OpenEnd Sub |
 |
|
|
|
|
|