Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 11th, 2004, 09:10 AM
Registered User
 
Join Date: Jul 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems connecting SQL Server from VB 6

Hi!

I have made a program which uses a database in SQL Server 2000 (SP3) via DSN from VB6 (Y2K SP4). When I run the program in VB everything is just fine but when I install the program on any other pc connection doesn't work any more. This happens even if it's me who is logged on the pc. There are several users including me who should be able to use the database in SQL Server. The users have usernames in database.

I use DSN and in code as following: strConn = "DSN=databasename;"... I tried to add TrustedConnection=yes to the end of the line but it doesn't seem to help.

Thanks!
 
Old February 11th, 2004, 12:18 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Firstly I would advise agaianst connection via dsn, you must create them on every machine that uses the application. Try using a dsn-less connection, there are lots of examples at:

www.connectionstrings.com

--

Joe
 
Old February 11th, 2004, 12:59 PM
Authorized User
 
Join Date: Jun 2003
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

We have an interesting situation here at GOVT where many of our batch jobs use DSN's - and one thing this is saving us much work is that somebody in their great wisdom had decided we must change all our server names from mountain names, Rainier, Bachlor, Hood, etc - to forest names, Spruce, Pine, Alder, etc.

So we just have to change the DSN's and not worry about all the app's that use them.

_________________________
Joe Horton
Database Developer / Software Engineer
WISHA/Legal Services Software Development
Department of Labor and Industries
Voice (360) 902-5928 fax (360) 902-6200
 
Old February 11th, 2004, 01:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Default

mikko,

You may need to explicitly name the server in the DSN. This is necessary if you exist in a multi-server environment. If you don't explicitly name the server, the DSN will pick the default server which may be different for each pc.

Rand
 
Old February 11th, 2004, 02:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Default

We also use a lot of DSN's. The most difficult thing is standardizing them. I have a short VB utility program which allows me to create standardized DSN's from an internal array. It's designed to hold 28 DSN's and will create them very quickly. If anyone is interested, contact me directly ([email protected]) and I will supply the source code.

Rand
 
Old February 12th, 2004, 04:08 AM
Authorized User
 
Join Date: Jun 2003
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by hortoristic
 We have an interesting situation here at GOVT where many of our batch jobs use DSN's - and one thing this is saving us much work is that somebody in their great wisdom had decided we must change all our server names from mountain names, Rainier, Bachlor, Hood, etc - to forest names, Spruce, Pine, Alder, etc.

So we just have to change the DSN's and not worry about all the app's that use them.

_________________________
Joe Horton
Database Developer / Software Engineer
WISHA/Legal Services Software Development
Department of Labor and Industries
Voice (360) 902-5928 fax (360) 902-6200
i would use a Microsoft Data Link (.udl) file for the connection in such cases, since a file is easier to manage.

defiant.
 
Old February 12th, 2004, 05:37 AM
Registered User
 
Join Date: Jul 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi!

Thank you for your answers. Actually I am aware of most of what you have written. I was just wondering if the connection text is not correct: "dsn="name". Has anyone experiences of same kind of situation. As far as I know I've done everything as I am supposed to do and it still won't work.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems connecting to SQL Server - correct post KW C# 2005 4 September 3rd, 2007 11:53 AM
problems connecting to SQL Server KW C# 2005 0 August 31st, 2007 05:59 PM
Having problems connecting VB to SQL schow ASP.NET 2.0 Basics 0 March 28th, 2007 11:22 PM
Connecting to SQL server 2000 with VB 2005 Express ericgelders Visual Basic 2005 Basics 0 February 20th, 2007 06:15 PM
URGENT:Connecting SQL server through Proxy server sankar SQL Server 2000 0 August 26th, 2003 03:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.