-
Connecting to SQL Server using server authentication.
I need to connect to a SQL Server using server authentication.
Currently I have a SQL Server database define as an ODBC data source.
I to connect to that data source in my VB pgm using the following:
txtDsn = "SqlSevDsn"
txtUid = "My_Id"
txtPws = "My_Password"
txtConnectionString = "PROVIDER=MSDASQL;" & _
"DSN=" & txtDsn & ";" & _
"UID=" & txtUid & ";PWD=;" & txtPws
mds_cnn.ConnectionString = txtConnectionString
mds_cnn.Open
When mds_cnn.Open executes the following messages are returned :
Err.Number: -2147217843
Err.Description: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed
for user 'My_Id'.
Err.Source: Microsoft OLE DB Provider for ODBC Drivers
I suspect that SQL Server's server authentication is causing me the grief.
Would someone tell me what I'm doing wrong?
I'm working in a VB 6, SQL Server 7, NT environment.
Thanks in advance for any help.
James
-
Re: Connecting to SQL Server using server authentication.
I mixed up the password part of my connection string.
Sorry about that.
"James" <tbt102@hotmail.com> wrote:
>
>I need to connect to a SQL Server using server authentication.
>
>Currently I have a SQL Server database define as an ODBC data source.
>I to connect to that data source in my VB pgm using the following:
>
>txtDsn = "SqlSevDsn"
>txtUid = "My_Id"
>txtPws = "My_Password"
> txtConnectionString = "PROVIDER=MSDASQL;" & _
> "DSN=" & txtDsn & ";" & _
> "UID=" & txtUid & ";PWD=;" & txtPws
> mds_cnn.ConnectionString = txtConnectionString
> mds_cnn.Open
>
>When mds_cnn.Open executes the following messages are returned :
>
> Err.Number: -2147217843
> Err.Description: [Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed
>for user 'My_Id'.
> Err.Source: Microsoft OLE DB Provider for ODBC Drivers
>
>I suspect that SQL Server's server authentication is causing me the grief.
>Would someone tell me what I'm doing wrong?
>
>I'm working in a VB 6, SQL Server 7, NT environment.
>
>Thanks in advance for any help.
>
>James
-
Re: Connecting to SQL Server using server authentication.
I assume you mean you want to connect using NT Authentication?
IF so try somthing like this
ado_connection.ConnectionString = "Provider=" & strProvider _
& ";Integrated Security=SSPI;" _
& "Persist Security Info=False;Initial Catalog=" _
& strDB & ";" & "Data Source=" & strServer & ";"
"James" <tbt102@hotmail.com> wrote:
>
>I need to connect to a SQL Server using server authentication.
>
>Currently I have a SQL Server database define as an ODBC data source.
>I to connect to that data source in my VB pgm using the following:
>
>txtDsn = "SqlSevDsn"
>txtUid = "My_Id"
>txtPws = "My_Password"
> txtConnectionString = "PROVIDER=MSDASQL;" & _
> "DSN=" & txtDsn & ";" & _
> "UID=" & txtUid & ";PWD=;" & txtPws
> mds_cnn.ConnectionString = txtConnectionString
> mds_cnn.Open
>
>When mds_cnn.Open executes the following messages are returned :
>
> Err.Number: -2147217843
> Err.Description: [Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed
>for user 'My_Id'.
> Err.Source: Microsoft OLE DB Provider for ODBC Drivers
>
>I suspect that SQL Server's server authentication is causing me the grief.
>Would someone tell me what I'm doing wrong?
>
>I'm working in a VB 6, SQL Server 7, NT environment.
>
>Thanks in advance for any help.
>
>James
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks