Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 11th, 2004, 08:10 AM
Registered User
 
Join Date: Jul 2003
Location: , , Finland.
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!
Reply With Quote
  #2 (permalink)  
Old February 11th, 2004, 11:18 AM
joefawcett's Avatar
Wrox Author
Points: 9,712, Level: 42
Points: 9,712, Level: 42 Points: 9,712, Level: 42 Points: 9,712, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,066
Thanks: 1
Thanked 36 Times in 35 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
Reply With Quote
  #3 (permalink)  
Old February 11th, 2004, 11:59 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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
Reply With Quote
  #4 (permalink)  
Old February 11th, 2004, 12:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Naperville, IL, USA.
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
Reply With Quote
  #5 (permalink)  
Old February 11th, 2004, 01:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Naperville, IL, USA.
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 (rgerald@usbnc.org) and I will supply the source code.

Rand
Reply With Quote
  #6 (permalink)  
Old February 12th, 2004, 03:08 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Romania.
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.
Reply With Quote
  #7 (permalink)  
Old February 12th, 2004, 04:37 AM
Registered User
 
Join Date: Jul 2003
Location: , , Finland.
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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 05:15 PM
URGENT:Connecting SQL server through Proxy server sankar SQL Server 2000 0 August 26th, 2003 03:50 AM



All times are GMT -4. The time now is 12:16 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.